diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-10-23 13:10:51 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-03-28 13:11:01 -0400 |
commit | 3c1a8ee7d7af658eb9e4cb927559907c09d13c6c (patch) | |
tree | 2b1f0a4c72e800db18f145c6a70692d1d6c32632 /activerecord/lib | |
parent | fe37da4ebf227cd9b1056eed8b0a35ae86037de3 (diff) | |
download | rails-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.rb | 2 |
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 |