From 29e34c332687be9456578a9b5f60adb10f4e10b5 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 7 Mar 2017 18:04:44 +0200 Subject: Preserve order by priority on issues board --- app/models/issue.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models/issue.rb') diff --git a/app/models/issue.rb b/app/models/issue.rb index 0f7a26ee3e1..dba9398a43c 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -96,6 +96,13 @@ class Issue < ActiveRecord::Base end end + def self.order_by_position_and_priority + order_labels_priority. + reorder(Gitlab::Database.nulls_last_order('relative_position', 'ASC'), + Gitlab::Database.nulls_last_order('highest_priority', 'ASC'), + "id DESC") + end + # `from` argument can be a Namespace or Project. def to_reference(from = nil, full: false) reference = "#{self.class.reference_prefix}#{iid}" -- cgit v1.2.1 From dd53a9c0132d48393ca11e29825b599a5a1454a7 Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Tue, 14 Mar 2017 11:56:15 -0500 Subject: Include time tracking attributes in webhooks payload --- app/models/issue.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/models/issue.rb') diff --git a/app/models/issue.rb b/app/models/issue.rb index 0f7a26ee3e1..2cc237635f9 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -58,7 +58,13 @@ class Issue < ActiveRecord::Base end def hook_attrs - attributes + attrs = { + total_time_spent: total_time_spent, + human_total_time_spent: human_total_time_spent, + human_time_estimate: human_time_estimate + } + + attributes.merge!(attrs) end def self.reference_prefix -- cgit v1.2.1