diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type/decimal.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/type/decimal.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/decimal.rb b/activerecord/lib/active_record/connection_adapters/type/decimal.rb index 91957fe84b..6fb1a6c3b0 100644 --- a/activerecord/lib/active_record/connection_adapters/type/decimal.rb +++ b/activerecord/lib/active_record/connection_adapters/type/decimal.rb @@ -11,7 +11,11 @@ module ActiveRecord private def cast_value(value) - Column.value_to_decimal(value) + if value.respond_to?(:to_d) + value.to_d + else + value.to_s.to_d + end end end end |