diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/finders/milestones_finder.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/finders/milestones_finder.rb')
-rw-r--r-- | app/finders/milestones_finder.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/finders/milestones_finder.rb b/app/finders/milestones_finder.rb index cfe648d9f79..8f0cdf3b255 100644 --- a/app/finders/milestones_finder.rb +++ b/app/finders/milestones_finder.rb @@ -58,10 +58,8 @@ class MilestonesFinder 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') + sort_by = params[:sort].presence || 'due_date_asc' + items.sort_by_attribute(sort_by) end - # rubocop: enable CodeReuse/ActiveRecord end |