Module: MultipleTableInheritance::Child::Base::DelegateMethods
- Defined in:
- lib/multiple_table_inheritance/child/base.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
137
138
139
140
141
142
143
|
# File 'lib/multiple_table_inheritance/child/base.rb', line 137
def method_missing(name, *args, &block)
if parent_association.respond_to?(name)
parent_association.send(name, *args, &block)
else
super(name, *args, &block)
end
end
|
Instance Method Details
#respond_to?(name, *args) ⇒ Boolean
145
146
147
148
|
# File 'lib/multiple_table_inheritance/child/base.rb', line 145
def respond_to?(name, *args)
return true if name.to_sym == :parent_association
super(name, *args) || parent_association.respond_to?(name)
end
|