diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/finders/milestones_finder.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/finders/milestones_finder.rb')
-rw-r--r-- | app/finders/milestones_finder.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/finders/milestones_finder.rb b/app/finders/milestones_finder.rb index 8f0cdf3b255..16e59b31b36 100644 --- a/app/finders/milestones_finder.rb +++ b/app/finders/milestones_finder.rb @@ -3,6 +3,7 @@ # Search for milestones # # params - Hash +# ids - filters by id. # project_ids: Array of project ids or single project id or ActiveRecord relation. # group_ids: Array of group ids or single group id or ActiveRecord relation. # order - Orders by field default due date asc. @@ -21,6 +22,7 @@ class MilestonesFinder def execute items = Milestone.all + items = by_ids(items) items = by_groups_and_projects(items) items = by_title(items) items = by_search_title(items) @@ -32,6 +34,12 @@ class MilestonesFinder private + def by_ids(items) + return items unless params[:ids].present? + + items.id_in(params[:ids]) + end + def by_groups_and_projects(items) items.for_projects_and_groups(params[:project_ids], params[:group_ids]) end |