aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/join_dependency/join_association.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency/join_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb8
1 files changed, 3 insertions, 5 deletions
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 98b2f40357..a526468bf6 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative "join_part"
module ActiveRecord
@@ -21,11 +23,8 @@ module ActiveRecord
super && reflection == other.reflection
end
- JoinInformation = Struct.new :joins, :binds
-
def join_constraints(foreign_table, foreign_klass, join_type, tables, chain)
joins = []
- binds = []
tables = tables.reverse
# The chain starts with the target table, but we want to end with it here (makes
@@ -41,7 +40,6 @@ module ActiveRecord
join_scope = reflection.join_scope(table, foreign_klass)
if join_scope.arel.constraints.any?
- binds.concat join_scope.bound_attributes
joins.concat join_scope.arel.join_sources
right = joins.last.right
right.expr = right.expr.and(join_scope.arel.constraints)
@@ -51,7 +49,7 @@ module ActiveRecord
foreign_table, foreign_klass = table, klass
end
- JoinInformation.new joins, binds
+ joins
end
def table