Permalink
Browse files

not a relation. it's an arel select manager

  • Loading branch information...
1 parent 62affac commit 6303cef42c91639642d38a58112b4921927e2ce1 Neeraj Singh committed Apr 2, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 activerecord/lib/active_record/associations/join_dependency/join_association.rb
View
8 activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -59,7 +59,7 @@ def find_parent_in(other_join_dependency)
end
end
- def join_to(relation)
+ def join_to(manager)
tables = @tables.dup
foreign_table = parent_table
foreign_klass = parent.active_record
@@ -75,7 +75,7 @@ def join_to(relation)
foreign_key = reflection.foreign_key
when :has_and_belongs_to_many
# Join the join table first...
- relation.from(join(
+ manager.from(join(
table,
table[reflection.foreign_key].
eq(foreign_table[reflection.active_record_primary_key])
@@ -109,13 +109,13 @@ def join_to(relation)
constraint = constraint.and(item.arel.constraints) unless item.arel.constraints.empty?
end
- relation.from(join(table, constraint))
+ manager.from(join(table, constraint))
# The current table in this iteration becomes the foreign table in the next
foreign_table, foreign_klass = table, reflection.klass
end
- relation
+ manager
end
def build_constraint(reflection, table, key, foreign_table, foreign_key)

0 comments on commit 6303cef

Please sign in to comment.