aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-06-20 18:48:51 -0400
committerGitHub <noreply@github.com>2017-06-20 18:48:51 -0400
commit0787727cd65d820df78c9cd71ac9f145c9834762 (patch)
treefff3410cce7656b2b149528e3f60a39b4775dc12 /activerecord/lib
parent890de7705257323d05c8831b8c1ab43433b0ba89 (diff)
parent4d1264cb5afb93dba198dc559c22a88521fc45c4 (diff)
downloadrails-0787727cd65d820df78c9cd71ac9f145c9834762.tar.gz
rails-0787727cd65d820df78c9cd71ac9f145c9834762.tar.bz2
rails-0787727cd65d820df78c9cd71ac9f145c9834762.zip
Merge pull request #28914 from bogdanvlviv/fix-touch-with-optimistic-locking
Fix ActiveRecord::Persistence#touch with locking
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/persistence.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index f652c7c3a1..b2dba5516e 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -526,7 +526,7 @@ module ActiveRecord
if locking_enabled?
locking_column = self.class.locking_column
- scope = scope.where(locking_column => _read_attribute(locking_column))
+ scope = scope.where(locking_column => read_attribute_before_type_cast(locking_column))
changes[locking_column] = increment_lock
end