Sha256: 822af6583faf18dca65baa7ce5182e2c542bd1a185c2bff42879e157765ef75d

Contents?: true

Size: 414 Bytes

Versions: 5

Compression:

Stored size: 414 Bytes

Contents

module Polyamorous
  module JoinDependencyExtensions
    # Replaces ActiveRecord::Associations::JoinDependency#make_inner_joins
    #
    def make_polyamorous_inner_joins(parent, child)
      make_constraints(
        parent, child, child.tables, child.join_type || Arel::Nodes::InnerJoin
      )
      .concat child.children.flat_map { |c|
        make_polyamorous_inner_joins(child, c)
      }
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
ransack-1.8.10 lib/polyamorous/activerecord_4.1_ruby_2/make_polyamorous_inner_joins.rb
ransack-1.8.9 lib/polyamorous/activerecord_4.1_ruby_2/make_polyamorous_inner_joins.rb
polyamorous-1.3.3 lib/polyamorous/activerecord_4.1_ruby_2/make_polyamorous_inner_joins.rb
polyamorous-1.3.2 lib/polyamorous/activerecord_4.1_ruby_2/make_polyamorous_inner_joins.rb
polyamorous-1.3.1 lib/polyamorous/activerecord_4.1_ruby_2/make_polyamorous_inner_joins.rb