instance method
method_missing
Ruby on Rails 8.0.4
Since v7.1.6 PrivateSignature
method_missing(name, ...)
No documentation comment.
Parameters
-
namereq -
...req
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 475
def method_missing(name, ...)
# We can't know whether some method was defined or not because
# multiple thread might be concurrently be in this code path.
# So the first one would define the methods and the others would
# appear to already have them.
self.class.define_attribute_methods
# So in all cases we must behave as if the method was just defined.
method = begin
self.class.public_instance_method(name)
rescue NameError
nil
end
# The method might be explicitly defined in the model, but call a generated
# method with super. So we must resume the call chain at the right step.
method = method.super_method while method && !method.owner.is_a?(GeneratedAttributeMethods)
if method
method.bind_call(self, ...)
else
super
end
end
Defined in activerecord/lib/active_record/attribute_methods.rb line 475
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods