aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/engines/sql
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2010-05-21 11:45:12 -0400
committerErnie Miller <ernie@metautonomo.us>2010-05-21 11:45:12 -0400
commit43bfd3fae496a2a859aad0a654a91437357c3450 (patch)
treebd95f3b7add4ba7841a6fa9dd717de9c60ea90a8 /lib/arel/engines/sql
parentd144b8d5af11c819b8f70a97006998bf89ee926c (diff)
downloadrails-43bfd3fae496a2a859aad0a654a91437357c3450.tar.gz
rails-43bfd3fae496a2a859aad0a654a91437357c3450.tar.bz2
rails-43bfd3fae496a2a859aad0a654a91437357c3450.zip
Fix tests to work properly on Ruby 1.9, honor multiple calls to #order in memory engine, and make having clauses behave like where clauses in SQL engine (join with AND, allow multiple calls to having to add predicates)
Diffstat (limited to 'lib/arel/engines/sql')
-rw-r--r--lib/arel/engines/sql/relations/compiler.rb4
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?