summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2019-01-17 15:35:23 +0100
committerJacopo <beschi.jacopo@gmail.com>2019-01-24 18:44:09 +0100
commit22eb2e4c227b060981bb37708222cdd07e825542 (patch)
treec02c037a5877e1f7075a99806336fef8cb3b03bc /app/finders
parente520a946410ca0007a2a562f2c2a7c6f8c6f1dab (diff)
downloadgitlab-ce-22eb2e4c227b060981bb37708222cdd07e825542.tar.gz
Adds milestone search
Adds to search ILIKE search for milestones title in: - Milestones dashboard - Group milestones page - Project milestones page
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/milestones_finder.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/finders/milestones_finder.rb b/app/finders/milestones_finder.rb
index fcd54b6106e..77b55cbb838 100644
--- a/app/finders/milestones_finder.rb
+++ b/app/finders/milestones_finder.rb
@@ -22,6 +22,7 @@ class MilestonesFinder
items = Milestone.all
items = by_groups_and_projects(items)
items = by_title(items)
+ items = by_search_title(items)
items = by_state(items)
order(items)
@@ -43,6 +44,14 @@ class MilestonesFinder
end
# rubocop: enable CodeReuse/ActiveRecord
+ def by_search_title(items)
+ if params[:search_title].present?
+ items.search_title(params[:search_title])
+ else
+ items
+ end
+ end
+
def by_state(items)
Milestone.filter_by_state(items, params[:state])
end