aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-15 15:14:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-15 15:14:25 -0700
commitdb2e21aa0eed26835d02b874ce97afa6c8abd3e2 (patch)
tree656d2b248ad7445402393d7cc4d23a6d440dbb93
parent66556631f5b98990d55194f427533a4b992b3350 (diff)
downloadrails-db2e21aa0eed26835d02b874ce97afa6c8abd3e2.tar.gz
rails-db2e21aa0eed26835d02b874ce97afa6c8abd3e2.tar.bz2
rails-db2e21aa0eed26835d02b874ce97afa6c8abd3e2.zip
stop reversing tables until we absolutely must
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb2
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index 68bdd41101..66cc5bd3ac 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -170,7 +170,7 @@ module ActiveRecord
reflection.table_name,
table_alias_for(reflection, parent, reflection != node.reflection)
)
- }.reverse
+ }
end
def table_alias_for(reflection, parent, join)
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 b47ee17aff..9677d1219a 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -27,7 +27,7 @@ module ActiveRecord
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 @@ module ActiveRecord
end
def table
- tables.last
+ tables.first
end
def aliased_table_name