From d7207cf504b67243c0b7debaff70d948bb8be7a8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 12 Oct 2010 16:39:29 -0700 Subject: type casting bound value based on column associated with value --- activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 0ea45dd61d..6598feec62 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -146,7 +146,9 @@ module ActiveRecord stmt = cache[:stmt] cols = cache[:cols] ||= stmt.columns stmt.reset! - stmt.bind_params bind_values.map { |col, val| val } + stmt.bind_params bind_values.map { |col, val| + col ? col.type_cast(val) : val + } end ActiveRecord::Result.new(cols, stmt.to_a) -- cgit v1.2.3