Permalink
Browse files

fold the collection rather than multiple assigments

  • Loading branch information...
1 parent d440fa0 commit 220f1a0cfbf0e63eb200eb0bd9b58405cfa1b6e4 @tenderlove tenderlove committed May 22, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 activerecord/lib/active_record/associations/join_dependency.rb
@@ -56,10 +56,9 @@ def join_base
end
def join_relation(relation)
- join_associations.each do |association|
- relation = association.join_relation(relation)
+ join_associations.inject(relation) do |rel,association|
+ association.join_relation(rel)
end
- relation
end
def columns

0 comments on commit 220f1a0

Please sign in to comment.