diff options
author | Sean McGivern <sean@gitlab.com> | 2017-03-10 11:10:48 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-03-15 17:02:37 +0000 |
commit | 101fddfa9203fbcc96151e880a3a1241338a91f2 (patch) | |
tree | cd4df611aebd5cd594da22eaefaad73eb190ab1b /app/models/todo.rb | |
parent | 6619772f2a7a12fcef86ce530e45705bbbf09dcc (diff) | |
download | gitlab-ce-101fddfa9203fbcc96151e880a3a1241338a91f2.tar.gz |
Allow sorting by due date and label priority
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r-- | app/models/todo.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb index 47789a21133..da3fa7277c2 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -48,8 +48,14 @@ class Todo < ActiveRecord::Base after_save :keep_around_commit class << self + # Priority sorting isn't displayed in the dropdown, because we don't show + # milestones, but still show something if the user has a URL with that + # selected. def sort(method) - method == "priority" ? order_by_labels_priority : order_by(method) + case method.to_s + when 'priority', 'label_priority' then order_by_labels_priority + else order_by(method) + end end # Order by priority depending on which issue/merge request the Todo belongs to |