project_deploy_token.rb 313 Bytes
Newer Older
1 2
# frozen_string_literal: true

Mayra Cabrera's avatar
Mayra Cabrera committed
3 4 5 6 7 8 9 10
class ProjectDeployToken < ActiveRecord::Base
  belongs_to :project
  belongs_to :deploy_token, inverse_of: :project_deploy_tokens

  validates :deploy_token, presence: true
  validates :project, presence: true
  validates :deploy_token_id, uniqueness: { scope: [:project_id] }
end