diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 11:30:22 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 11:38:43 -0800 |
commit | 4dec00a9d8262d85b733aa3bd5b68d2b7de950a7 (patch) | |
tree | 19bcbf9a7f511815d2b17a61cf43c0c66efe432e | |
parent | 82944b95a909965ddec189058fb2040dcf0aa54a (diff) | |
download | rails-4dec00a9d8262d85b733aa3bd5b68d2b7de950a7.tar.gz rails-4dec00a9d8262d85b733aa3bd5b68d2b7de950a7.tar.bz2 rails-4dec00a9d8262d85b733aa3bd5b68d2b7de950a7.zip |
manager will always be a manager
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index b2f741026b..a98b650524 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -270,17 +270,13 @@ module ActiveRecord manager = association.join_to(manager) end - if Arel::Table === manager - manager.from(join_ast || manager) + if manager.froms.length > 0 && join_ast + join_ast.left = manager.froms.first + manager.from join_ast + elsif manager.froms.length == 0 && join_ast + manager.from(join_ast) else - if manager.froms.length > 0 && join_ast - join_ast.left = manager.froms.first - manager.from join_ast - elsif manager.froms.length == 0 && join_ast - manager.from(join_ast) - else - manager - end + manager end end |