aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-10 11:37:55 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-10 11:38:43 -0800
commit7d8fd5723600c1290177e665cfd8136031f8abd1 (patch)
treee59cccae3afa5488c990743ada1088a948cf3ae2 /activerecord
parentec72b6b3ec1b78c22189ee475c1af2fdab317489 (diff)
downloadrails-7d8fd5723600c1290177e665cfd8136031f8abd1.tar.gz
rails-7d8fd5723600c1290177e665cfd8136031f8abd1.tar.bz2
rails-7d8fd5723600c1290177e665cfd8136031f8abd1.zip
no more manager manipulation if there is no custom join ast
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 145ae6ca97..08b61c9752 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -270,12 +270,11 @@ module ActiveRecord
manager = association.join_to(manager)
end
- if manager.froms.length > 0 && join_ast
- join_ast.left = manager.froms.first
- manager.from join_ast
- else
- manager
- end
+ return manager unless join_ast
+
+ join_ast.left = manager.froms.first
+ manager.from join_ast
+ manager
end
def build_select(arel, selects)