Skip to content

Commit

Permalink
Merge pull request #377 from Eric-Guo/master
Browse files Browse the repository at this point in the history
Follow up #370 for Oracle, to fix undefined method `expr' for 10:Fixnum bug.
  • Loading branch information
rafaelfranca committed Jul 13, 2015
2 parents 14df08d + 74563c6 commit ce1a5a7
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.expr
limit = o.limit.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 @@ -111,7 +111,7 @@ def compile node

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

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

0 comments on commit ce1a5a7

Please sign in to comment.