summaryrefslogtreecommitdiffstats
path: root/lib/redmine
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-14 07:15:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-14 07:15:13 +0000
commitd2f7e31951d0e150df9cfd6da7d91d855f734d5f (patch)
tree35dfd4e7ff86f66c9eacb5bec14c63e920913896 /lib/redmine
parente58e676b7c15bb3f837f660f857d8e2a3e35f233 (diff)
downloadredmine-d2f7e31951d0e150df9cfd6da7d91d855f734d5f.tar.gz
redmine-d2f7e31951d0e150df9cfd6da7d91d855f734d5f.zip
Use .distinct instead of .uniq.
git-svn-id: http://svn.redmine.org/redmine/trunk@15654 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r--lib/redmine/helpers/gantt.rb2
-rw-r--r--lib/redmine/nested_set/issue_nested_set.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index 683d201a5..79902d370 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -168,7 +168,7 @@ module Redmine
joins("LEFT JOIN #{Project.table_name} child ON #{Project.table_name}.lft <= child.lft AND #{Project.table_name}.rgt >= child.rgt").
where("child.id IN (?)", ids).
order("#{Project.table_name}.lft ASC").
- uniq.
+ distinct.
to_a
else
@projects = []
diff --git a/lib/redmine/nested_set/issue_nested_set.rb b/lib/redmine/nested_set/issue_nested_set.rb
index 932f56351..afbe6b995 100644
--- a/lib/redmine/nested_set/issue_nested_set.rb
+++ b/lib/redmine/nested_set/issue_nested_set.rb
@@ -176,7 +176,7 @@ module Redmine
reorder(:id).lock.ids
update_all(:root_id => nil, :lft => nil, :rgt => nil)
where(:parent_id => nil).update_all(["root_id = id, lft = ?, rgt = ?", 1, 2])
- roots_with_children = joins("JOIN #{table_name} parent ON parent.id = #{table_name}.parent_id AND parent.id = parent.root_id").uniq.pluck("parent.id")
+ roots_with_children = joins("JOIN #{table_name} parent ON parent.id = #{table_name}.parent_id AND parent.id = parent.root_id").distinct.pluck("parent.id")
roots_with_children.each do |root_id|
rebuild_nodes(root_id)
end