mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
inserting big decimals as strings works consistently among dbs, so use string form
This commit is contained in:
parent
8571facea3
commit
27f8c57f5f
2 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ module ActiveRecord
|
|||
end
|
||||
# BigDecimals need to be put in a non-normalized form and quoted.
|
||||
when nil then nil
|
||||
when BigDecimal then value.to_f
|
||||
when BigDecimal then value.to_s('F')
|
||||
when Numeric then value
|
||||
when Date, Time then quoted_date(value)
|
||||
when Symbol then value.to_s
|
||||
|
|
|
@ -67,7 +67,7 @@ module ActiveRecord
|
|||
|
||||
def test_type_cast_bigdecimal
|
||||
bd = BigDecimal.new '10.0'
|
||||
assert_equal bd.to_f, @conn.type_cast(bd, nil)
|
||||
assert_equal bd.to_s('F'), @conn.type_cast(bd, nil)
|
||||
end
|
||||
|
||||
def test_type_cast_unknown
|
||||
|
|
Loading…
Reference in a new issue