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
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/ransack-4.2.1/lib/polyamorous/swapping_reflection_class.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/ransack-4.2.1/lib/polyamorous/swapping_reflection_class.rb
ransack-4.2.1 lib/polyamorous/swapping_reflection_class.rb
ransack-4.2.0 lib/polyamorous/swapping_reflection_class.rb
ransack-4.1.1 lib/polyamorous/swapping_reflection_class.rb
ransack-4.1.0 lib/polyamorous/swapping_reflection_class.rb
ransack-4.0.0 lib/polyamorous/swapping_reflection_class.rb
ransack-3.2.1 lib/polyamorous/swapping_reflection_class.rb
ransack-3.2.0 lib/polyamorous/swapping_reflection_class.rb
ransack-3.1.0 lib/polyamorous/swapping_reflection_class.rb
ransack-3.0.1 lib/polyamorous/swapping_reflection_class.rb
ransack-3.0.0 lib/polyamorous/swapping_reflection_class.rb
ransack-2.6.0 lib/polyamorous/swapping_reflection_class.rb
ransack-2.5.0 lib/polyamorous/swapping_reflection_class.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/ransack-2.4.2/lib/polyamorous/swapping_reflection_class.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/ransack-2.4.2/lib/polyamorous/swapping_reflection_class.rb
ransack-2.4.2 lib/polyamorous/swapping_reflection_class.rb
ransack-2.4.1 lib/polyamorous/swapping_reflection_class.rb
ransack-2.4.0 lib/polyamorous/swapping_reflection_class.rb
polyamorous-2.3.2 lib/polyamorous/swapping_reflection_class.rb