summaryrefslogtreecommitdiff
path: root/app/models/todo.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-14 20:06:26 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:27 -0200
commit3c2aaec1f2624ad4817e7ac52120985682afa448 (patch)
tree45832f21636e5a33557f715a5d95c36c6be290a9 /app/models/todo.rb
parent99e928f103182b58156edb107b55344eaafc6772 (diff)
downloadgitlab-ce-3c2aaec1f2624ad4817e7ac52120985682afa448.tar.gz
Fix sorting by label priorities
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r--app/models/todo.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb
index 6ae9956ade5..fd90a893d2e 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -52,7 +52,7 @@ class Todo < ActiveRecord::Base
# Todos with highest priority first then oldest todos
# Need to order by created_at last because of differences on Mysql and Postgres when joining by type "Merge_request/Issue"
def order_by_labels_priority
- highest_priority = highest_label_priority(["Issue", "MergeRequest"], "todos.target_id").to_sql
+ highest_priority = highest_label_priority(["Issue", "MergeRequest"], "todos.project_id", "todos.target_id").to_sql
select("#{table_name}.*, (#{highest_priority}) AS highest_priority").
order(Gitlab::Database.nulls_last_order('highest_priority', 'ASC')).