aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/dirty.rb
diff options
context:
space:
mode:
authorChris Salzberg <chris@dejimata.com>2019-04-13 10:48:26 +0900
committerChris Salzberg <chris@dejimata.com>2019-04-13 11:12:39 +0900
commitc9d75177fe87ee1348c79d042c6449970eb47879 (patch)
tree1e63a7553e9c0127baf1d86f6d55ecac9f1acef4 /activemodel/lib/active_model/dirty.rb
parentbdcdb2b35f938a29c15669d4a870c2530c9ab440 (diff)
downloadrails-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/lib/active_model/dirty.rb')
-rw-r--r--activemodel/lib/active_model/dirty.rb14
1 files changed, 7 insertions, 7 deletions
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)