No need to patch `make_constraints`, apparently
This method changes a lot in Rails 6.1. If we can rely on Rails version, everything is easier.
This commit is contained in:
parent
e1be118369
commit
cbe52b1627
|
@ -45,13 +45,6 @@ module Polyamorous
|
|||
end
|
||||
|
||||
private
|
||||
def make_constraints(parent, child, join_type = Arel::Nodes::OuterJoin)
|
||||
foreign_table = parent.table
|
||||
foreign_klass = parent.base_klass
|
||||
join_type = child.join_type || join_type if join_type == Arel::Nodes::InnerJoin
|
||||
joins = child.join_constraints(foreign_table, foreign_klass, join_type, alias_tracker)
|
||||
joins.concat child.children.flat_map { |c| make_constraints(child, c, join_type) }
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
# Prepended before ActiveRecord::Associations::JoinDependency#walk_tree
|
||||
|
|
Loading…
Reference in New Issue