diff options
author | Chris Salzberg <chris@dejimata.com> | 2019-04-13 10:48:26 +0900 |
---|---|---|
committer | Chris Salzberg <chris@dejimata.com> | 2019-04-13 11:12:39 +0900 |
commit | c9d75177fe87ee1348c79d042c6449970eb47879 (patch) | |
tree | 1e63a7553e9c0127baf1d86f6d55ecac9f1acef4 /activemodel | |
parent | bdcdb2b35f938a29c15669d4a870c2530c9ab440 (diff) | |
download | rails-c9d75177fe87ee1348c79d042c6449970eb47879.tar.gz rails-c9d75177fe87ee1348c79d042c6449970eb47879.tar.bz2 rails-c9d75177fe87ee1348c79d042c6449970eb47879.zip |
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.
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/attributes.rb | 2 | ||||
-rw-r--r-- | activemodel/lib/active_model/dirty.rb | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/activemodel/lib/active_model/attributes.rb b/activemodel/lib/active_model/attributes.rb index c3a446098c..b7b2f35bcc 100644 --- a/activemodel/lib/active_model/attributes.rb +++ b/activemodel/lib/active_model/attributes.rb @@ -91,7 +91,7 @@ module ActiveModel @attributes.fetch_value(name) end - # Handle *= for method_missing. + # Dispatch target for <tt>*=</tt> attribute methods. def attribute=(attribute_name, value) write_attribute(attribute_name, value) end 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 <tt>*_changed?</tt> for +method_missing+. + # Dispatch target for <tt>*_changed?</tt> attribute methods. def attribute_changed?(attr_name, **options) # :nodoc: mutations_from_database.changed?(attr_name.to_s, options) end - # Handles <tt>*_was</tt> for +method_missing+. + # Dispatch target for <tt>*_was</tt> attribute methods. def attribute_was(attr_name) # :nodoc: mutations_from_database.original_value(attr_name.to_s) end - # Handles <tt>*_previously_changed?</tt> for +method_missing+. + # Dispatch target for <tt>*_previously_changed?</tt> 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 <tt>*_change</tt> for +method_missing+. + # Dispatch target for <tt>*_change</tt> attribute methods. def attribute_change(attr_name) mutations_from_database.change_to_attribute(attr_name.to_s) end - # Handles <tt>*_previous_change</tt> for +method_missing+. + # Dispatch target for <tt>*_previous_change</tt> attribute methods. def attribute_previous_change(attr_name) mutations_before_last_save.change_to_attribute(attr_name.to_s) end - # Handles <tt>*_will_change!</tt> for +method_missing+. + # Dispatch target for <tt>*_will_change!</tt> attribute methods. def attribute_will_change!(attr_name) mutations_from_database.force_change(attr_name.to_s) end - # Handles <tt>restore_*!</tt> for +method_missing+. + # Dispatch target for <tt>restore_*!</tt> attribute methods. def restore_attribute!(attr_name) attr_name = attr_name.to_s if attribute_changed?(attr_name) |