aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-10-23 13:10:51 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-03-28 13:11:01 -0400
commit3c1a8ee7d7af658eb9e4cb927559907c09d13c6c (patch)
tree2b1f0a4c72e800db18f145c6a70692d1d6c32632 /activerecord/lib
parentfe37da4ebf227cd9b1056eed8b0a35ae86037de3 (diff)
downloadrails-3c1a8ee7d7af658eb9e4cb927559907c09d13c6c.tar.gz
rails-3c1a8ee7d7af658eb9e4cb927559907c09d13c6c.tar.bz2
rails-3c1a8ee7d7af658eb9e4cb927559907c09d13c6c.zip
Merge pull request #30956 from CJStadler/with-lock-changed-deprecation
Fix deprecation warnings from with_lock
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/locking/pessimistic.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/locking/pessimistic.rb b/activerecord/lib/active_record/locking/pessimistic.rb
index bb85c47e06..5d1d15c94d 100644
--- a/activerecord/lib/active_record/locking/pessimistic.rb
+++ b/activerecord/lib/active_record/locking/pessimistic.rb
@@ -62,7 +62,7 @@ module ActiveRecord
# the locked record.
def lock!(lock = true)
if persisted?
- if changed?
+ if has_changes_to_save?
raise(<<-MSG.squish)
Locking a record with unpersisted changes is not supported. Use
`save` to persist the changes, or `reload` to discard them