1
0
Fork 0
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:
Rafael Mendonça França 2014-05-05 11:58:29 -03:00
commit a8f4a49e37
2 changed files with 3 additions and 3 deletions

View file

@ -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 << "

View file

@ -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