summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-08 10:11:16 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-08 10:11:16 +0000
commit78ca50560a25eb1f75969b93129d494c34717c72 (patch)
tree59b0b2a465e0d31448a4fc60a66e8202889da80e /lib/plugins
parent74ccf34361908dd17d70848bd770d166f44c96b7 (diff)
downloadredmine-78ca50560a25eb1f75969b93129d494c34717c72.tar.gz
redmine-78ca50560a25eb1f75969b93129d494c34717c72.zip
Rails4: replace deprecated Relation#update_all at acts_as_list
git-svn-id: http://svn.redmine.org/redmine/trunk@12526 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acts_as_list/lib/active_record/acts/list.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/plugins/acts_as_list/lib/active_record/acts/list.rb b/lib/plugins/acts_as_list/lib/active_record/acts/list.rb
index 3c1ba5216..f1887eed4 100644
--- a/lib/plugins/acts_as_list/lib/active_record/acts/list.rb
+++ b/lib/plugins/acts_as_list/lib/active_record/acts/list.rb
@@ -137,7 +137,8 @@ module ActiveRecord
def reset_positions_in_list
acts_as_list_class.where(scope_condition).reorder("#{position_column} ASC, id ASC").each_with_index do |item, i|
unless item.send(position_column) == (i + 1)
- acts_as_list_class.update_all({position_column => (i + 1)}, {:id => item.id})
+ acts_as_list_class.where({:id => item.id}).
+ update_all({position_column => (i + 1)})
end
end
end