diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 17:29:19 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-30 17:29:19 -0800 |
commit | 7408b6ec842c87644460430827b8ce27e43ccfc7 (patch) | |
tree | e3515a9b44571b7d0d6565195e19c1d082f357eb /activerecord | |
parent | f1758525f940eb6c4dd4178784db2ba66316083d (diff) | |
download | rails-7408b6ec842c87644460430827b8ce27e43ccfc7.tar.gz rails-7408b6ec842c87644460430827b8ce27e43ccfc7.tar.bz2 rails-7408b6ec842c87644460430827b8ce27e43ccfc7.zip |
just grep the AST for OuterJoin nodes rather than converting the tree to SQL
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 013b878293..fd45bb24dd 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -166,7 +166,7 @@ module ActiveRecord if operation == "count" column_name ||= (select_for_count || :all) - if arel.join_sql =~ /LEFT OUTER/i + unless arel.ast.grep(Arel::Nodes::OuterJoin).empty? distinct = true column_name = @klass.primary_key if column_name == :all end |