diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-07 03:07:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-07 03:07:23 +0300 |
commit | 3462d7613fb761a4cbf2904c6980fd39b6f8bd5f (patch) | |
tree | 62d64c80f804f3cee283de4642c089d327ed61b8 /app/finders | |
parent | c47ade2adb94e4c33f87b4b825c92c7fe61ef044 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/environments/environments_finder.rb | 9 |
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) |