aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_to_sql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/visitors/test_to_sql.rb')
-rw-r--r--test/visitors/test_to_sql.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb
index 3af316037a..c47fd57a28 100644
--- a/test/visitors/test_to_sql.rb
+++ b/test/visitors/test_to_sql.rb
@@ -281,6 +281,15 @@ module Arel
}
end
end
+
+ describe 'TableAlias' do
+ it "should use the underlying table for checking columns" do
+ test = Table.new(:users).alias('zomgusers')[:id].eq '3'
+ @visitor.accept(test).must_be_like %{
+ "zomgusers"."id" = 3
+ }
+ end
+ end
end
end
end