diff options
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 f5d2b9f253a..47231ea80c7 100644 --- a/app/finders/milestones_finder.rb +++ b/app/finders/milestones_finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Search for milestones # # params - Hash @@ -18,6 +20,7 @@ class MilestonesFinder @params = params end + # rubocop: disable CodeReuse/ActiveRecord def execute return Milestone.none if project_ids.empty? && group_ids.empty? @@ -28,6 +31,7 @@ class MilestonesFinder order(items) end + # rubocop: enable CodeReuse/ActiveRecord private @@ -35,6 +39,7 @@ class MilestonesFinder items.for_projects_and_groups(project_ids, group_ids) end + # rubocop: disable CodeReuse/ActiveRecord def by_title(items) if params[:title] items.where(title: params[:title]) @@ -42,13 +47,16 @@ class MilestonesFinder items end end + # rubocop: enable CodeReuse/ActiveRecord def by_state(items) Milestone.filter_by_state(items, params[:state]) end + # rubocop: disable CodeReuse/ActiveRecord def order(items) order_statement = Gitlab::Database.nulls_last_order('due_date', 'ASC') items.reorder(order_statement).order('title ASC') end + # rubocop: enable CodeReuse/ActiveRecord end |