diff options
author | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2009-03-23 00:19:27 +0200 |
---|---|---|
committer | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2009-08-06 23:40:59 +0300 |
commit | 04e6bc1134c7165d455106767c5caabb5993e52b (patch) | |
tree | 12e736f63ebcb1d6516bd0d8819fa4141ee9ae54 /activerecord | |
parent | 5d0dece6a69c31437b29396a3d4d04f092a9fc1f (diff) | |
download | rails-04e6bc1134c7165d455106767c5caabb5993e52b.tar.gz rails-04e6bc1134c7165d455106767c5caabb5993e52b.tar.bz2 rails-04e6bc1134c7165d455106767c5caabb5993e52b.zip |
Oracle adapter recourns count() as numeric (not string)
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/query_cache_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index f90a66d1dc..2af6a56b6a 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -50,7 +50,12 @@ class QueryCacheTest < ActiveRecord::TestCase def test_cache_does_not_wrap_string_results_in_arrays Task.cache do - assert_instance_of String, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks") + # Oracle adapter returns count() as Fixnum or Float + if current_adapter?(:OracleAdapter) + assert Task.connection.select_value("SELECT count(*) AS count_all FROM tasks").is_a?(Numeric) + else + assert_instance_of String, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks") + end end end end |