From: Toshi MARUYAMA Date: Wed, 8 Jan 2014 10:11:16 +0000 (+0000) Subject: Rails4: replace deprecated Relation#update_all at acts_as_list X-Git-Tag: 2.5.0~373 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=78ca50560a25eb1f75969b93129d494c34717c72;p=redmine.git 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 --- 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