Sha256: 64b745845e2d372c565286607ad5e2a1a72f046e9e02aa1f0c8e64d14f3042be

Contents?: true

Size: 379 Bytes

Versions: 41

Compression:

Stored size: 379 Bytes

Contents

module Polyamorous
  module SwappingReflectionClass
    def swapping_reflection_klass(reflection, klass)
      new_reflection = reflection.clone
      new_reflection.instance_variable_set(:@options, reflection.options.clone)
      new_reflection.options.delete(:polymorphic)
      new_reflection.instance_variable_set(:@klass, klass)
      yield new_reflection
    end
  end
end

Version data entries

41 entries across 40 versions & 7 rubygems

Version Path
polyamorous-2.3.1 lib/polyamorous/swapping_reflection_class.rb
ransack-2.3.2 polyamorous/lib/polyamorous/swapping_reflection_class.rb
ransack-2.3.1 polyamorous/lib/polyamorous/swapping_reflection_class.rb
polyamorous-2.3.0 lib/polyamorous/swapping_reflection_class.rb
ransack-2.3.0 polyamorous/lib/polyamorous/swapping_reflection_class.rb
temp_poly-2.1.1a lib/polyamorous/swapping_reflection_class.rb
ransack-1.8.10 lib/polyamorous/swapping_reflection_class.rb
ransack-2.1.1 lib/polyamorous/swapping_reflection_class.rb
ransack-2.1.0 lib/polyamorous/swapping_reflection_class.rb
ransack-2.0.1 lib/polyamorous/swapping_reflection_class.rb
ransack-2.0.0 lib/polyamorous/swapping_reflection_class.rb
ransack-1.8.9 lib/polyamorous/swapping_reflection_class.rb
polyamorous-1.3.3 lib/polyamorous/swapping_reflection_class.rb
polyamorous-1.3.2 lib/polyamorous/swapping_reflection_class.rb
polyamorous-1.3.1 lib/polyamorous/swapping_reflection_class.rb
polyamorous-1.3.0 lib/polyamorous/swapping_reflection_class.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/polyamorous-1.2.0/lib/polyamorous/swapping_reflection_class.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/polyamorous-1.2.0/lib/polyamorous/swapping_reflection_class.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/polyamorous-1.2.0/lib/polyamorous/swapping_reflection_class.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/polyamorous-1.2.0/lib/polyamorous/swapping_reflection_class.rb