Sha256: 93668bfab9c443dfeec5290014e3a4ffb14c2b1f7f09f3defc25322ec5a6d2aa

Contents?: true

Size: 978 Bytes

Versions: 6

Compression:

Stored size: 978 Bytes

Contents

if defined?(::ActiveRecord)
  module Polyamorous
    InnerJoin = Arel::Nodes::InnerJoin
    OuterJoin = Arel::Nodes::OuterJoin

    JoinDependency  = ::ActiveRecord::Associations::JoinDependency
    JoinAssociation = ::ActiveRecord::Associations::JoinDependency::JoinAssociation
  end

  require 'polyamorous/tree_node'
  require 'polyamorous/join'
  require 'polyamorous/swapping_reflection_class'

  ar_version = ::ActiveRecord::VERSION::STRING[0,3]
  %w(join_association join_dependency reflection).each do |file|
    require "polyamorous/activerecord_#{ar_version}_ruby_2/#{file}"
  end

  ActiveRecord::Reflection::AbstractReflection.send(:prepend, Polyamorous::ReflectionExtensions)

  Polyamorous::JoinDependency.send(:prepend, Polyamorous::JoinDependencyExtensions)
  Polyamorous::JoinDependency.singleton_class.send(:prepend, Polyamorous::JoinDependencyExtensions::ClassMethods)
  Polyamorous::JoinAssociation.send(:prepend, Polyamorous::JoinAssociationExtensions)
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ransack-2.4.1 lib/polyamorous/polyamorous.rb
ransack-2.4.0 lib/polyamorous/polyamorous.rb
polyamorous-2.3.2 lib/polyamorous.rb
polyamorous-2.3.1 lib/polyamorous.rb
ransack-2.3.2 polyamorous/lib/polyamorous.rb
ransack-2.3.1 polyamorous/lib/polyamorous.rb