aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2017-01-03 11:17:16 -0500
committerGitHub <noreply@github.com>2017-01-03 11:17:16 -0500
commit948cebd017b6fd02b6be0d9d469adc8a297fb249 (patch)
treebbe65adb9eea00bfe44035a4c530bf041b839b85 /activerecord/lib
parentec7255a2d6f49f7f7b305c10a50f65bfd2a1511e (diff)
parent5fd226e5f4e7d53f3acb433f00d1a8808cf7af82 (diff)
downloadrails-948cebd017b6fd02b6be0d9d469adc8a297fb249.tar.gz
rails-948cebd017b6fd02b6be0d9d469adc8a297fb249.tar.bz2
rails-948cebd017b6fd02b6be0d9d469adc8a297fb249.zip
Merge pull request #27491 from kamipo/add_missing_emit_warning
Add missing `emit_warning_if_needed` for `changed?`
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/attribute_methods/dirty.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb
index e20b65e43c..b0e1391cb9 100644
--- a/activerecord/lib/active_record/attribute_methods/dirty.rb
+++ b/activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -226,6 +226,11 @@ module ActiveRecord
super
end
+ def changed?(*)
+ emit_warning_if_needed("changed?", "saved_changes?")
+ super
+ end
+
def changed(*)
emit_warning_if_needed("changed", "saved_changes.keys")
super