rails/arel — pull request #266 by yahonda (2014-05-05 14:57:36+00:00)
Title: Support to add the casting node to the AST at build time to oracle

This pull request addresses 36 errors when ActiveRecord unit test executed with oracle database.

Since o.limit is Quoted by https://github.com/rails/arel/commit/93d72131bcc24ccb5536bec672d2dac94f8de651 . I have not find other way to "unquote" other than `o.limit.expr.expr`, chaining `expr` method twice is little bit strange (for me).

One of 36 error test case is:

```ruby
$ cd activerecord
$ ARCONN=oracle ruby -Itest test/cases/relations_test.rb -n test_finding_with_order_limit_and_offset
Using oracle
Run options: -n test_finding_with_order_limit_and_offset --seed 63979

# Running:

E

Finished in 0.925014s, 1.0811 runs/s, 0.0000 assertions/s.

1) Error:
RelationTest#test_finding_with_order_limit_and_offset:
NoMethodError: undefined method `to_i' for #
/home/yahonda/git/arel/lib/arel/visitors/oracle.rb:20:in `visit_Arel_Nodes_SelectStatement'
/home/yahonda/git/arel/lib/arel/visitors/reduce.rb:13:in `visit'
/home/yahonda/git/arel/lib/arel/visitors/reduce.rb:7:in `accept'
/home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:12:in `to_sql'
/home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
/home/yahonda/git/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
/home/yahonda/git/rails/activerecord/lib/active_record/querying.rb:39:in `find_by_sql'
/home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:613:in `exec_queries'
/home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:489:in `load'
/home/yahonda/git/rails/activerecord/lib/active_record/relation.rb:233:in `to_a'
test/cases/relations_test.rb:294:in `test_finding_with_order_limit_and_offset'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
$
```

- `rake test_oracle` result without this commit
```ruby
3930 runs, 10937 assertions, 19 failures, 39 errors, 0 skips
```
- `rake test_oracle` result with this commit
```ruby
3930 runs, 10994 assertions, 19 failures, 3 errors, 0 skips
```
It would be very appreciated this commit reviewed. Thanks in advance,