2013-06-19 08:40:33 -04:00
|
|
|
# == 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 not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
#
|
|
|
|
|
2013-05-06 05:26:36 -04:00
|
|
|
class DeployKeysProject < ActiveRecord::Base
|
|
|
|
attr_accessible :key_id, :project_id
|
|
|
|
|
|
|
|
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
|