From 05887fc406820f2e8fecc5cedcc42b87cf9f0ab1 Mon Sep 17 00:00:00 2001 From: Ernie Miller Date: Sat, 12 Mar 2011 10:53:47 +0800 Subject: Make as factory method convert alias name to SqlLiteral --- test/nodes/test_as.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/nodes/test_as.rb b/test/nodes/test_as.rb index 8585fbc963..02cbe5f7b0 100644 --- a/test/nodes/test_as.rb +++ b/test/nodes/test_as.rb @@ -10,6 +10,12 @@ module Arel assert_equal attr, as.left assert_equal 'foo', as.right end + + it 'converts right to SqlLiteral if a string' do + attr = Table.new(:users)[:id] + as = attr.as('foo') + assert_kind_of Arel::Nodes::SqlLiteral, as.right + end end end end -- cgit v1.2.3