Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stop reversing tables until we absolutely must

  • Loading branch information...
commit db2e21aa0eed26835d02b874ce97afa6c8abd3e2 1 parent 6655663
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/associations/join_dependency.rb
@@ -170,7 +170,7 @@ def construct_tables!(parent, node)
reflection.table_name,
table_alias_for(reflection, parent, reflection != node.reflection)
)
- }.reverse
+ }
end
def table_alias_for(reflection, parent, join)
View
4 activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -27,7 +27,7 @@ def match?(other)
def join_constraints(parent, tables, chain)
joins = []
- tables = tables.dup
+ tables = tables.reverse
foreign_table = parent.table
foreign_klass = parent.base_klass
@@ -113,7 +113,7 @@ def build_constraint(klass, table, key, foreign_table, foreign_key)
end
def table
- tables.last
+ tables.first
end
def aliased_table_name
Please sign in to comment.
Something went wrong with that request. Please try again.