Fix BigDecimal Typecast on 1.8.7

ref #9208 https://github.com/rails/rails/pull/9208#issuecomment-13290985