Module: PolymorphicAsTable::BelongsToAssociation
- Defined in:
- lib/polymorphic_as_table/belongs_to_association.rb
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/polymorphic_as_table/belongs_to_association.rb', line 3 def self.included(base) base.class_eval do def association_class @owner[@reflection.[:foreign_type]].present? ? @owner[@reflection.[:foreign_type]].classify.constantize : nil end end end |