diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-06-06 15:53:31 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-06-16 11:59:39 -0300 |
commit | ff7fe2d12dec6c76b5a90b2c95cca81152cc5d42 (patch) | |
tree | 726116e5ec1812fa5795e77f132e6bc5a70b8a0e /app/models/milestone.rb | |
parent | 5f42009f8dcc29d559ee415e92c88858e361f063 (diff) | |
download | gitlab-ce-ff7fe2d12dec6c76b5a90b2c95cca81152cc5d42.tar.gz |
Remove Drag and drop and sorting from milestone view
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index b04bed4c014..0a6fc064aec 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -164,38 +164,6 @@ class Milestone < ActiveRecord::Base write_attribute(:title, sanitize_title(value)) if value.present? end - # Sorts the issues for the given IDs. - # - # This method runs a single SQL query using a CASE statement to update the - # position of all issues in the current milestone (scoped to the list of IDs). - # - # Given the ids [10, 20, 30] this method produces a SQL query something like - # the following: - # - # UPDATE issues - # SET position = CASE - # WHEN id = 10 THEN 1 - # WHEN id = 20 THEN 2 - # WHEN id = 30 THEN 3 - # ELSE position - # END - # WHERE id IN (10, 20, 30); - # - # This method expects that the IDs given in `ids` are already Fixnums. - def sort_issues(ids) - pairs = [] - - ids.each_with_index do |id, index| - pairs << id - pairs << index + 1 - end - - conditions = 'WHEN id = ? THEN ? ' * ids.length - - issues.where(id: ids). - update_all(["position = CASE #{conditions} ELSE position END", *pairs]) - end - private def milestone_format_reference(format = :iid) |