diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-11-30 08:14:13 -0500 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-11-30 10:58:40 -0500 |
commit | ef993d36bc952046f312a3695617eaa6d5fe352e (patch) | |
tree | 944c9f831d6b7142b6f7a232fcbd49deb0e0b977 /activerecord/lib/active_record/attribute_methods | |
parent | dc844844f5a2aafc8489da5b567475da3af3e78d (diff) | |
download | rails-ef993d36bc952046f312a3695617eaa6d5fe352e.tar.gz rails-ef993d36bc952046f312a3695617eaa6d5fe352e.tar.bz2 rails-ef993d36bc952046f312a3695617eaa6d5fe352e.zip |
Correct deprecation warnings in `ActiveRecord::Dirty`
I had pointed the messages at the new behavior, not the old.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index b22190455a..e20b65e43c 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -100,14 +100,14 @@ module ActiveRecord if defined?(@cached_changed_attributes) @cached_changed_attributes else - emit_warning_if_needed("changed_attributes", "attributes_in_database") + emit_warning_if_needed("changed_attributes", "saved_changes.transform_values(&:first)") super.reverse_merge(mutation_tracker.changed_values).freeze end end def changes cache_changed_attributes do - emit_warning_if_needed("changes", "changes_to_save") + emit_warning_if_needed("changes", "saved_changes") super end end @@ -212,22 +212,22 @@ module ActiveRecord end def attribute_was(*) - emit_warning_if_needed("attribute_was", "attribute_in_database") + emit_warning_if_needed("attribute_was", "attribute_before_last_save") super end def attribute_change(*) - emit_warning_if_needed("attribute_change", "attribute_change_to_be_saved") + emit_warning_if_needed("attribute_change", "saved_change_to_attribute") super end def attribute_changed?(*) - emit_warning_if_needed("attribute_changed?", "will_save_change_to_attribute?") + emit_warning_if_needed("attribute_changed?", "saved_change_to_attribute?") super end def changed(*) - emit_warning_if_needed("changed", "changed_attribute_names_to_save") + emit_warning_if_needed("changed", "saved_changes.keys") super end |