diff --git a/activemodel/lib/active_model/attributes.rb b/activemodel/lib/active_model/attributes.rb
index c3a446098c984..b7b2f35bccb02 100644
--- a/activemodel/lib/active_model/attributes.rb
+++ b/activemodel/lib/active_model/attributes.rb
@@ -91,7 +91,7 @@ def attribute(attr_name)
@attributes.fetch_value(name)
end
- # Handle *= for method_missing.
+ # Dispatch target for *= 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 ab2c9d04ae40a..35a587658cd10 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -165,17 +165,17 @@ def changed
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 @@ def mutations_before_last_save
@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)
diff --git a/activerecord/lib/active_record/attribute_methods/before_type_cast.rb b/activerecord/lib/active_record/attribute_methods/before_type_cast.rb
index 5941f51a1a69b..dc239ff9ea339 100644
--- a/activerecord/lib/active_record/attribute_methods/before_type_cast.rb
+++ b/activerecord/lib/active_record/attribute_methods/before_type_cast.rb
@@ -65,7 +65,7 @@ def attributes_before_type_cast
private
- # Handle *_before_type_cast for method_missing.
+ # Dispatch target for *_before_type_cast attribute methods.
def attribute_before_type_cast(attribute_name)
read_attribute_before_type_cast(attribute_name)
end
diff --git a/activerecord/lib/active_record/attribute_methods/query.rb b/activerecord/lib/active_record/attribute_methods/query.rb
index 6811f54b10f9c..0cf67644af4ee 100644
--- a/activerecord/lib/active_record/attribute_methods/query.rb
+++ b/activerecord/lib/active_record/attribute_methods/query.rb
@@ -32,7 +32,7 @@ def query_attribute(attr_name)
end
private
- # Handle *? for method_missing.
+ # Dispatch target for *? attribute methods.
def attribute?(attribute_name)
query_attribute(attribute_name)
end
diff --git a/activerecord/lib/active_record/attribute_methods/write.rb b/activerecord/lib/active_record/attribute_methods/write.rb
index 455e67e19b76b..d5ba2f42cbb6c 100644
--- a/activerecord/lib/active_record/attribute_methods/write.rb
+++ b/activerecord/lib/active_record/attribute_methods/write.rb
@@ -58,7 +58,7 @@ def write_attribute_without_type_cast(attr_name, value)
value
end
- # Handle *= for method_missing.
+ # Dispatch target for *= attribute methods.
def attribute=(attribute_name, value)
_write_attribute(attribute_name, value)
end