aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-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)