diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/models/todo.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r-- | app/models/todo.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb index 0d893b25253..12dc9ce0fe6 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -139,13 +139,11 @@ class Todo < ApplicationRecord # 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 - params = { + highest_priority = highest_label_priority( target_type_column: "todos.target_type", target_column: "todos.target_id", project_column: "todos.project_id" - } - - highest_priority = highest_label_priority(params).to_sql + ).to_sql select("#{table_name}.*, (#{highest_priority}) AS highest_priority") .order(Gitlab::Database.nulls_last_order('highest_priority', 'ASC')) |