diff options
author | Suraj N. Kurapati <sunaku@gmail.com> | 2012-09-22 15:27:10 -0700 |
---|---|---|
committer | Suraj N. Kurapati <sunaku@gmail.com> | 2012-09-22 15:27:10 -0700 |
commit | c001fadd2f2f420267db809439581e388684e9de (patch) | |
tree | 14200d7a8835e36f686cbaba590a3e4ae5aaa2f0 /test | |
parent | e032dabdb2adb34e3db8cd35e9f58bc0536475c1 (diff) | |
download | rails-c001fadd2f2f420267db809439581e388684e9de.tar.gz rails-c001fadd2f2f420267db809439581e388684e9de.tar.bz2 rails-c001fadd2f2f420267db809439581e388684e9de.zip |
to_sql: add support for emitting SQL subqueries
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_to_sql.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index 1caedacd45..064f14739c 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -126,6 +126,11 @@ module Arel @visitor.accept(nil).must_be_like "NULL" end + it "should visit_Arel_SelectManager, which is a subquery" do + mgr = Table.new(:foo).project(:bar) + @visitor.accept(mgr).must_be_like '(SELECT bar FROM "foo")' + end + it "should visit_Arel_Nodes_And" do node = Nodes::And.new [@attr.eq(10), @attr.eq(11)] @visitor.accept(node).must_be_like %{ |