From 948424d5566dcacb726124d343d013d299c90105 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 24 Feb 2015 14:10:29 -0700 Subject: Call `attributes_for_update` in `_update_record` w/ optimistic locking Fixes #19057 --- activerecord/lib/active_record/locking/optimistic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/locking') diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index a58d8355aa..a09437b4b0 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -93,7 +93,7 @@ module ActiveRecord self.class.primary_key => id, lock_col => previous_lock_value, ).update_all( - attribute_names.map do |name| + attributes_for_update(attribute_names).map do |name| [name, _read_attribute(name)] end.to_h ) -- cgit v1.2.3