diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index b0eaec66a10cce3a6e3fd9d179593fae55be34e5..8f2c6f269c2370cf00c60c5904777da814e6eeb2 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -52,7 +52,7 @@ def self.get_bind_values(owner, chain) attr_reader :value_transformation def join(table, constraint) - table.create_join(table, table.create_on(constraint), Arel::Nodes::LeadingJoin) + Arel::Nodes::LeadingJoin.new(table, Arel::Nodes::On.new(constraint)) end def last_chain_scope(scope, reflection, owner) diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index 1f1e1ba6b52b4bda4ea9667db392898fc586f2b6..98b18e53b68ab9734fbd9167e11f5be9669d93e4 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -50,7 +50,7 @@ def join_constraints(foreign_table, foreign_klass, join_type, alias_tracker, &bl end end - joins << table.create_join(table, table.create_on(nodes), join_type) + joins << join_type.new(table, Arel::Nodes::On.new(nodes)) if others && !others.empty? joins.concat arel.join_sources @@ -79,7 +79,7 @@ def strict_loading? private def append_constraints(join, constraints) if join.is_a?(Arel::Nodes::StringJoin) - join_string = table.create_and(constraints.unshift(join.left)) + join_string = Arel::Nodes::And.new(constraints.unshift join.left) join.left = Arel.sql(base_klass.connection.visitor.compile(join_string)) else right = join.right diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 005707f94ada14484ce07170893d343e0249ffa9..bd1f438e57d8a8b5f06de95b3131c8e4470fd89c 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -1252,7 +1252,7 @@ def build_join_buckets end joins.each_with_index do |join, i| - joins[i] = table.create_string_join(Arel.sql(join.strip)) if join.is_a?(String) + joins[i] = Arel::Nodes::StringJoin.new(Arel.sql(join.strip)) if join.is_a?(String) end while joins.first.is_a?(Arel::Nodes::Join)