diff options
Diffstat (limited to 'lib/arel/engines/sql/relations/compiler.rb')
-rw-r--r-- | lib/arel/engines/sql/relations/compiler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/arel/engines/sql/relations/compiler.rb b/lib/arel/engines/sql/relations/compiler.rb index 43d0e1aeb9..c8511374d9 100644 --- a/lib/arel/engines/sql/relations/compiler.rb +++ b/lib/arel/engines/sql/relations/compiler.rb @@ -14,7 +14,7 @@ module Arel def select_sql projections = @relation.projections - if projections.first.is_a?(Count) && projections.size == 1 && + if Count === projections.first && projections.size == 1 && (relation.taken.present? || relation.wheres.present?) && relation.joins(self).blank? subquery = [ "SELECT 1 FROM #{relation.from_clauses}", build_clauses |