Module: Polyamorous::SwappingReflectionClass
- Included in:
- JoinAssociationExtensions
- Defined in:
- lib/polyamorous/swapping_reflection_class.rb
Instance Method Summary collapse
Instance Method Details
#swapping_reflection_klass(reflection, klass) {|new_reflection| ... } ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/polyamorous/swapping_reflection_class.rb', line 3 def swapping_reflection_klass(reflection, klass) new_reflection = reflection.clone new_reflection.instance_variable_set(:@options, reflection..clone) new_reflection..delete(:polymorphic) new_reflection.instance_variable_set(:@klass, klass) yield new_reflection end |