Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Extended by:
- Base::ClassMethods
- Defined in:
- lib/activerecord/base/instance_methods.rb
Instance Attribute Summary
Attributes included from Base::ClassMethods
Instance Method Summary collapse
-
#method_missing(method, *args, &block) ⇒ Object
delegates method calls for unknown methods to the tableless model.
Methods included from Base::ClassMethods
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
delegates method calls for unknown methods to the tableless model
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/activerecord/base/instance_methods.rb', line 6 def method_missing method, *args, &block if self.class.tableless_models self.class.tableless_models.each do |column_name| serialized_attribute = send(column_name) return serialized_attribute.send(method, *args, &block) if serialized_attribute.respond_to?(method) end end super method, *args, &block end |