gitlab-org--gitlab-foss/app/models/deploy_key.rb
2013-05-06 15:10:55 +03:00

6 lines
260 B
Ruby

class DeployKey < Key
has_many :deploy_keys_projects, dependent: :destroy
has_many :projects, through: :deploy_keys_projects
scope :in_projects, ->(projects) { joins(:deploy_keys_projects).where('deploy_keys_projects.project_id in (?)', projects) }
end