Catch up with rails/rails@999bf3d097
This commit is contained in:
parent
46212f1212
commit
a8ae1ce26b
|
@ -28,9 +28,14 @@ module Polyamorous
|
|||
end
|
||||
end
|
||||
|
||||
def join_constraints(joins_to_add, alias_tracker)
|
||||
def join_constraints(joins_to_add, alias_tracker, references)
|
||||
@alias_tracker = alias_tracker
|
||||
@joined_tables = {}
|
||||
@references = {}
|
||||
|
||||
references.each do |table_name|
|
||||
@references[table_name.to_sym] = table_name if table_name.is_a?(String)
|
||||
end
|
||||
|
||||
joins = make_join_constraints(join_root, join_type)
|
||||
|
||||
|
|
|
@ -99,7 +99,9 @@ module Ransack
|
|||
def join_sources
|
||||
base, joins = begin
|
||||
alias_tracker = ::ActiveRecord::Associations::AliasTracker.create(self.klass.connection, @object.table.name, [])
|
||||
constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_0)
|
||||
constraints = if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_1_ALPHA)
|
||||
@join_dependency.join_constraints(@object.joins_values, alias_tracker, @object.references_values)
|
||||
elsif ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new(Constants::RAILS_6_0)
|
||||
@join_dependency.join_constraints(@object.joins_values, alias_tracker)
|
||||
else
|
||||
@join_dependency.join_constraints(@object.joins_values, @join_type, alias_tracker)
|
||||
|
|
Loading…
Reference in New Issue