From c9d75177fe87ee1348c79d042c6449970eb47879 Mon Sep 17 00:00:00 2001 From: Chris Salzberg Date: Sat, 13 Apr 2019 10:48:26 +0900 Subject: Improve wording of comments Most of the time, these methods are called from actual methods defined from columns in the schema, not from method_missing, so the current wording is misleading. --- activemodel/lib/active_model/dirty.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'activemodel/lib/active_model/dirty.rb') diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb index ab2c9d04ae..35a587658c 100644 --- a/activemodel/lib/active_model/dirty.rb +++ b/activemodel/lib/active_model/dirty.rb @@ -165,17 +165,17 @@ module ActiveModel mutations_from_database.changed_attribute_names end - # Handles *_changed? for +method_missing+. + # Dispatch target for *_changed? attribute methods. def attribute_changed?(attr_name, **options) # :nodoc: mutations_from_database.changed?(attr_name.to_s, options) end - # Handles *_was for +method_missing+. + # Dispatch target for *_was attribute methods. def attribute_was(attr_name) # :nodoc: mutations_from_database.original_value(attr_name.to_s) end - # Handles *_previously_changed? for +method_missing+. + # Dispatch target for *_previously_changed? attribute methods. def attribute_previously_changed?(attr_name) # :nodoc: mutations_before_last_save.changed?(attr_name.to_s) end @@ -253,22 +253,22 @@ module ActiveModel @mutations_before_last_save ||= ActiveModel::NullMutationTracker.instance end - # Handles *_change for +method_missing+. + # Dispatch target for *_change attribute methods. def attribute_change(attr_name) mutations_from_database.change_to_attribute(attr_name.to_s) end - # Handles *_previous_change for +method_missing+. + # Dispatch target for *_previous_change attribute methods. def attribute_previous_change(attr_name) mutations_before_last_save.change_to_attribute(attr_name.to_s) end - # Handles *_will_change! for +method_missing+. + # Dispatch target for *_will_change! attribute methods. def attribute_will_change!(attr_name) mutations_from_database.force_change(attr_name.to_s) end - # Handles restore_*! for +method_missing+. + # Dispatch target for restore_*! attribute methods. def restore_attribute!(attr_name) attr_name = attr_name.to_s if attribute_changed?(attr_name) -- cgit v1.2.3