Skip to content
This repository
Browse code

fold the collection rather than multiple assigments

  • Loading branch information...
commit 220f1a0cfbf0e63eb200eb0bd9b58405cfa1b6e4 1 parent d440fa0
Aaron Patterson authored May 21, 2013
5  activerecord/lib/active_record/associations/join_dependency.rb
@@ -56,10 +56,9 @@ def join_base
56 56
       end
57 57
 
58 58
       def join_relation(relation)
59  
-        join_associations.each do |association|
60  
-          relation = association.join_relation(relation)
  59
+        join_associations.inject(relation) do |rel,association|
  60
+          association.join_relation(rel)
61 61
         end
62  
-        relation
63 62
       end
64 63
 
65 64
       def columns

0 notes on commit 220f1a0

Please sign in to comment.
Something went wrong with that request. Please try again.