diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-03 11:04:29 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-03 11:04:29 -0700 |
commit | 680464bd2f436eedb13bfb9dc24311df9fa679f1 (patch) | |
tree | a7b35a2a70d5b50218d047d04eb0618f98a920db /activerecord/lib | |
parent | c48c111bb2aa13d72f5ae6cf7d51a921766c7dfe (diff) | |
download | rails-680464bd2f436eedb13bfb9dc24311df9fa679f1.tar.gz rails-680464bd2f436eedb13bfb9dc24311df9fa679f1.tar.bz2 rails-680464bd2f436eedb13bfb9dc24311df9fa679f1.zip |
map the association chain to table names
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/join_helper.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/join_helper.rb b/activerecord/lib/active_record/associations/join_helper.rb index 68c36d47e8..f345d16841 100644 --- a/activerecord/lib/active_record/associations/join_helper.rb +++ b/activerecord/lib/active_record/associations/join_helper.rb @@ -10,14 +10,12 @@ module ActiveRecord private def construct_tables - tables = [] - chain.each do |reflection| - tables << alias_tracker.aliased_table_for( + chain.map do |reflection| + alias_tracker.aliased_table_for( table_name_for(reflection), table_alias_for(reflection, reflection != self.reflection) ) end - tables end def table_name_for(reflection) |