diff options
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 2618991c9e5..f51c9fab8dd 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -89,6 +89,7 @@ class Environment < ApplicationRecord scope :for_project, -> (project) { where(project_id: project) } scope :for_tier, -> (tier) { where(tier: tier).where.not(tier: nil) } + scope :with_deployments, -> { where('EXISTS (?)', Deployment.select(1).where('deployments.environment_id = environments.id')) } scope :with_deployment, -> (sha) { where('EXISTS (?)', Deployment.select(1).where('deployments.environment_id = environments.id').where(sha: sha)) } scope :unfoldered, -> { where(environment_type: nil) } scope :with_rank, -> do |