mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #266 from yahonda/address_undefined_to_i_oracle
Support to add the casting node to the AST at build time to oracle
This commit is contained in:
commit
a8f4a49e37
2 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ module Arel
|
|||
|
||||
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 << "
|
||||
|
|
|
@ -100,7 +100,7 @@ module Arel
|
|||
|
||||
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 %{
|
||||
|
@ -115,7 +115,7 @@ module Arel
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue