Method: ActiveRecord::AttributeMethods#method_missing

Defined in:
lib/active_record/attribute_methods.rb

#method_missing(method, *args, &block) ⇒ Object

If we haven’t generated any methods yet, generate them, then see if we’ve created the method we’re looking for.



138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/active_record/attribute_methods.rb', line 138

def method_missing(method, *args, &block)
  unless self.class.attribute_methods_generated?
    self.class.define_attribute_methods

    if respond_to_without_attributes?(method)
      send(method, *args, &block)
    else
      super
    end
  else
    super
  end
end