diff options
Diffstat (limited to 'lib/arel/engines/sql/relations/compiler.rb')
-rw-r--r-- | lib/arel/engines/sql/relations/compiler.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/engines/sql/relations/compiler.rb b/lib/arel/engines/sql/relations/compiler.rb index cc0deb7c88..374967b7be 100644 --- a/lib/arel/engines/sql/relations/compiler.rb +++ b/lib/arel/engines/sql/relations/compiler.rb @@ -12,9 +12,9 @@ module Arel "SELECT #{select_clauses.join(', ')}", "FROM #{from_clauses}", (joins(self) unless joins(self).blank? ), - ("WHERE #{where_clauses.join(" AND ")}" unless wheres.blank? ), + ("WHERE #{where_clauses.join(' AND ')}" unless wheres.blank? ), ("GROUP BY #{group_clauses.join(', ')}" unless groupings.blank? ), - ("HAVING #{having_clauses.join(', ')}" unless havings.blank? ), + ("HAVING #{having_clauses.join(' AND ')}" unless havings.blank? ), ("ORDER BY #{order_clauses.join(', ')}" unless orders.blank? ) engine.add_limit_offset!(query,{ :limit => taken, :offset => skipped }) if taken || skipped query << " #{locked}" unless locked.blank? |