If we haven’t generated any methods yet, generate them, then see if
we’ve created the method we’re looking for.
# File activerecord/lib/active_record/attribute_methods.rb, line 200
def method_missing(method, *args, &block) # :nodoc:
self.class.define_attribute_methods
if respond_to_without_attributes?(method)
# make sure to invoke the correct attribute method, as we might have gotten here via a `super`
# call in a overwritten attribute method
if attribute_method = self.class.find_generated_attribute_method(method)
# this is probably horribly slow, but should only happen at most once for a given AR class
attribute_method.bind(self).call(*args, &block)
else
return super unless respond_to_missing?(method, true)
send(method, *args, &block)
end
else
super
end
end