From f381da2738ec8c2aac3c34fead32688ea7b08d74 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 24 Sep 2010 11:17:17 -0700 Subject: adding more oracle hacks --- spec/arel/visitors/oracle_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/arel') diff --git a/spec/arel/visitors/oracle_spec.rb b/spec/arel/visitors/oracle_spec.rb index 07ac352893..0995ea6bf2 100644 --- a/spec/arel/visitors/oracle_spec.rb +++ b/spec/arel/visitors/oracle_spec.rb @@ -7,6 +7,18 @@ module Arel @visitor = Oracle.new Table.engine end + it 'modifies order when there is distinct and first value' do + # *sigh* + select = "DISTINCT foo.id, FIRST_VALUE(projects.name) OVER (foo) AS alias_0__" + stmt = Nodes::SelectStatement.new + stmt.cores.first.projections << Nodes::SqlLiteral.new(select) + stmt.orders << Nodes::SqlLiteral.new('foo') + sql = @visitor.accept(stmt) + sql.should be_like %{ + SELECT #{select} ORDER BY alias_0__ + } + end + describe 'Nodes::SelectStatement' do describe 'limit' do it 'adds a rownum clause' do -- cgit v1.2.3