diff options
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 7331000a9f2..30e5dfd096e 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -98,11 +98,11 @@ class Milestone < ActiveRecord::Base if Gitlab::Database.postgresql? rel.order(:project_id, :due_date).select('DISTINCT ON (project_id) id') else - rel. - group(:project_id). - having('due_date = MIN(due_date)'). - pluck(:id, :project_id, :due_date). - map(&:first) + rel + .group(:project_id) + .having('due_date = MIN(due_date)') + .pluck(:id, :project_id, :due_date) + .map(&:first) end end @@ -177,8 +177,8 @@ class Milestone < ActiveRecord::Base conditions = 'WHEN id = ? THEN ? ' * ids.length - issues.where(id: ids). - update_all(["position = CASE #{conditions} ELSE position END", *pairs]) + issues.where(id: ids) + .update_all(["position = CASE #{conditions} ELSE position END", *pairs]) end private |