Permalink
Browse files

map the association chain to table names

  • Loading branch information...
1 parent c48c111 commit 680464bd2f436eedb13bfb9dc24311df9fa679f1 @tenderlove tenderlove committed Oct 3, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 activerecord/lib/active_record/associations/join_helper.rb
View
6 activerecord/lib/active_record/associations/join_helper.rb
@@ -10,14 +10,12 @@ def join_type
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)

0 comments on commit 680464b

Please sign in to comment.