From aac9da257f291ad8d2d4f914528881c240848bb2 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 27 Jan 2015 09:52:54 -0700 Subject: Change the interface of `having` to match that of `where` These two clauses have nearly identical semantics with regards to how they would be constructed as an AST. It doesn't make sense for their interfaces to be separate. --- test/test_select_manager.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/test_select_manager.rb') diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 809f0de8df..7192027df4 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -111,22 +111,22 @@ module Arel it 'converts strings to SQLLiterals' do table = Table.new :users mgr = table.from - mgr.having 'foo' + mgr.having Arel.sql('foo') mgr.to_sql.must_be_like %{ SELECT FROM "users" HAVING foo } end it 'can have multiple items specified separately' do table = Table.new :users mgr = table.from - mgr.having 'foo' - mgr.having 'bar' + mgr.having Arel.sql('foo') + mgr.having Arel.sql('bar') mgr.to_sql.must_be_like %{ SELECT FROM "users" HAVING foo AND bar } end - it 'can have multiple items specified together' do + it 'can receive any node' do table = Table.new :users mgr = table.from - mgr.having 'foo', 'bar' + mgr.having Arel::Nodes::And.new([Arel.sql('foo'), Arel.sql('bar')]) mgr.to_sql.must_be_like %{ SELECT FROM "users" HAVING foo AND bar } end end -- cgit v1.2.3