summaryrefslogtreecommitdiff
path: root/app/finders/environments/environments_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/environments/environments_finder.rb')
-rw-r--r--app/finders/environments/environments_finder.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/finders/environments/environments_finder.rb b/app/finders/environments/environments_finder.rb
index 190cdb3dec3..46c49f096c6 100644
--- a/app/finders/environments/environments_finder.rb
+++ b/app/finders/environments/environments_finder.rb
@@ -16,6 +16,7 @@ module Environments
environments = project.environments
environments = by_name(environments)
environments = by_search(environments)
+ environments = by_ids(environments)
# Raises InvalidStatesError if params[:states] contains invalid states.
by_states(environments)
@@ -47,6 +48,14 @@ module Environments
end
end
+ def by_ids(environments)
+ if params[:environment_ids].present?
+ environments.for_id(params[:environment_ids])
+ else
+ environments
+ end
+ end
+
def environments_with_states(environments)
# Convert to array of strings
states = Array(params[:states]).map(&:to_s)