aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-20 10:44:36 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-20 14:39:01 -0700
commit09a488456aecf2b4ef7f200546b281cabda56e2f (patch)
tree84c0d478916d97b2a17e1d45e0760c734600e304 /activerecord/lib
parent993d0f6477c6dce4eb207578c1d0970cec859447 (diff)
downloadrails-09a488456aecf2b4ef7f200546b281cabda56e2f.tar.gz
rails-09a488456aecf2b4ef7f200546b281cabda56e2f.tar.bz2
rails-09a488456aecf2b4ef7f200546b281cabda56e2f.zip
bigdecimal should be typecast to a float on sqlite3. fixes #2162
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index 724b2e6d9c..e2a0f63393 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -157,6 +157,11 @@ module ActiveRecord
end
end
+ def type_cast(value, column) # :nodoc:
+ return super unless BigDecimal === value
+
+ value.to_f
+ end
# DATABASE STATEMENTS ======================================