Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
backporting beda2d4 for newer sqlite-ruby bindings
Signed-off-by: Xavier Noria <fxn@hashref.com>
  • Loading branch information
tenderlove authored and fxn committed May 22, 2010
1 parent 25ec613 commit a637b5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activerecord/test/cases/calculations_test.rb
Expand Up @@ -297,7 +297,7 @@ def test_count_with_scoped_has_many_through_association
end

def test_should_sum_expression
assert_equal '636', Account.sum("2 * credit_limit")
assert_equal 636, Account.sum("2 * credit_limit").to_i
end

def test_count_with_from_option
Expand Down
8 changes: 7 additions & 1 deletion activerecord/test/cases/query_cache_test.rb
Expand Up @@ -49,8 +49,14 @@ def test_cache_is_flat
end

def test_cache_does_not_wrap_string_results_in_arrays
require 'sqlite3/version' if current_adapter?(:SQLite3Adapter)

Task.cache do
assert_instance_of String, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
if current_adapter?(:SQLite3Adapter) && SQLite3::Version::VERSION > '1.2.5'
assert_instance_of Fixnum, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
else
assert_instance_of String, Task.connection.select_value("SELECT count(*) AS count_all FROM tasks")
end
end
end
end
Expand Down

0 comments on commit a637b5f

Please sign in to comment.