Skip to content

Commit

Permalink
Follow up #370 for Oracle, to fix undefined method `expr' for 10:Fixn…
Browse files Browse the repository at this point in the history
…um bug.
  • Loading branch information
Eric-Guo committed Jul 13, 2015
1 parent 14df08d commit 74563c6
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
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
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 74563c6

Please sign in to comment.