aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-08 10:35:26 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-08 10:35:26 -0800
commitddd6dee04343d3731b2f2fc558501c3707cde8fb (patch)
tree948dc47d280661b0bd27e6daef3c5bdb4ffcddf4
parent2fd385d47163149ec74029731bc29370fa768735 (diff)
downloadrails-ddd6dee04343d3731b2f2fc558501c3707cde8fb.tar.gz
rails-ddd6dee04343d3731b2f2fc558501c3707cde8fb.tar.bz2
rails-ddd6dee04343d3731b2f2fc558501c3707cde8fb.zip
further reducing dependence on custom_joins
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 705bf21eae..3a2cbc8dda 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -299,6 +299,8 @@ module ActiveRecord
if relation.froms.length > 0 && ast
ast.left = relation.froms.first
relation.from ast
+ elsif relation.froms.length == 0 && ast
+ relation.from(ast)
else
relation.join(custom_joins)
end