From 7832cd3bb3c6cfd76fdb63ca75995f2e6c87757c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 29 Jun 2011 13:45:26 -0700 Subject: fix depth first visitor to support ascending and descending nodes --- test/test_select_manager.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index e948aec131..119ad3ec4f 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -412,6 +412,15 @@ module Arel ast = mgr.ast mgr.visitor.accept(ast).must_equal mgr.to_sql end + it 'should allow orders to work when the ast is grepped' do + table = Table.new :users + mgr = table.from table + mgr.project Arel.sql '*' + mgr.from table + mgr.orders << Arel::Nodes::Ascending.new(Arel.sql('foo')) + mgr.ast.grep(Arel::Nodes::OuterJoin) + mgr.to_sql.must_be_like %{ SELECT * FROM "users" ORDER BY foo ASC } + end end describe 'taken' do -- cgit v1.2.3