aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/locking
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-24 14:10:29 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-24 14:10:29 -0700
commit948424d5566dcacb726124d343d013d299c90105 (patch)
tree3539d21a315809fec5a7dbe1ec3dc2dd6fade005 /activerecord/lib/active_record/locking
parent26915a18b197d6b062efbc7c89dc9555f29841ed (diff)
downloadrails-948424d5566dcacb726124d343d013d299c90105.tar.gz
rails-948424d5566dcacb726124d343d013d299c90105.tar.bz2
rails-948424d5566dcacb726124d343d013d299c90105.zip
Call `attributes_for_update` in `_update_record` w/ optimistic locking
Fixes #19057
Diffstat (limited to 'activerecord/lib/active_record/locking')
-rw-r--r--activerecord/lib/active_record/locking/optimistic.rb2
1 files changed, 1 insertions, 1 deletions
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
)