diff options
Diffstat (limited to 'app/models/deploy_key.rb')
-rw-r--r-- | app/models/deploy_key.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb index 6d9ec9a47e4..548ef4f9a27 100644 --- a/app/models/deploy_key.rb +++ b/app/models/deploy_key.rb @@ -1,4 +1,6 @@ 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 |