diff options
Diffstat (limited to 'app/finders/environments_finder.rb')
-rw-r--r-- | app/finders/environments_finder.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/finders/environments_finder.rb b/app/finders/environments_finder.rb index 52c73abc31d..a59f8c1efa3 100644 --- a/app/finders/environments_finder.rb +++ b/app/finders/environments_finder.rb @@ -17,12 +17,12 @@ class EnvironmentsFinder deployments.none end - environment_ids = deployments. - group(:environment_id). - select(:environment_id) + environment_ids = deployments + .group(:environment_id) + .select(:environment_id) - environments = project.environments.available. - where(id: environment_ids).order_by_last_deployed_at.to_a + environments = project.environments.available + .where(id: environment_ids).order_by_last_deployed_at.to_a environments.select! do |environment| Ability.allowed?(current_user, :read_environment, environment) |