Skip to content

Commit

Permalink
Support to add the casting node to the AST at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
yahonda committed May 5, 2014
1 parent e746106 commit 801a151
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/arel/visitors/oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def visit_Arel_Nodes_SelectStatement o, collector

if o.limit && o.offset
o = o.dup
limit = o.limit.expr.to_i
limit = o.limit.expr.expr
offset = o.offset
o.offset = nil
collector << "
Expand Down
4 changes: 2 additions & 2 deletions test/visitors/test_oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def compile node

it 'creates a different subquery when there is an offset' do
stmt = Nodes::SelectStatement.new
stmt.limit = Nodes::Limit.new(10)
stmt.limit = Nodes::Limit.new(Nodes.build_quoted(10))
stmt.offset = Nodes::Offset.new(10)
sql = compile stmt
sql.must_be_like %{
Expand All @@ -115,7 +115,7 @@ def compile node

it 'is idempotent with different subquery' do
stmt = Nodes::SelectStatement.new
stmt.limit = Nodes::Limit.new(10)
stmt.limit = Nodes::Limit.new(Nodes.build_quoted(10))
stmt.offset = Nodes::Offset.new(10)
sql = compile stmt
sql2 = compile stmt
Expand Down

0 comments on commit 801a151

Please sign in to comment.