diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 10:35:26 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-08 10:35:26 -0800 |
commit | ddd6dee04343d3731b2f2fc558501c3707cde8fb (patch) | |
tree | 948dc47d280661b0bd27e6daef3c5bdb4ffcddf4 /activerecord/lib/active_record/relation | |
parent | 2fd385d47163149ec74029731bc29370fa768735 (diff) | |
download | rails-ddd6dee04343d3731b2f2fc558501c3707cde8fb.tar.gz rails-ddd6dee04343d3731b2f2fc558501c3707cde8fb.tar.bz2 rails-ddd6dee04343d3731b2f2fc558501c3707cde8fb.zip |
further reducing dependence on custom_joins
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
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 |