gitlab-org--gitlab-foss/app/models/deploy_keys_project.rb
Dmitriy Zaporozhets 3a21c904dd
Use strong params for 5 more models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 15:00:09 +03:00

19 lines
548 B
Ruby

# == Schema Information
#
# Table name: deploy_keys_projects
#
# id :integer not null, primary key
# deploy_key_id :integer not null
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
#
class DeployKeysProject < ActiveRecord::Base
belongs_to :project
belongs_to :deploy_key
validates :deploy_key_id, presence: true
validates :deploy_key_id, uniqueness: { scope: [:project_id], message: "already exists in project" }
validates :project_id, presence: true
end