1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/lib
Kir Shatrov 7ec30400e1 Make BigDecimal casting consistent on different platforms
Right now it behaves differently on JRuby:

```
--- expected
+++ actual
@@ -1 +1 @@
-#<BigDecimal:5f3c866c,'0.333333333333333333',18(20)>
+#<BigDecimal:16e0afab,'0.3333333333333333',16(20)>
```

My initial PR (https://github.com/rails/rails/pull/27324)
offered to let the precision to be decided by the platform and
change the test expection, but other contributors suggested
that we should change the default precision in Rails
to be consistent of all platforms.

The value (18) comes from the max default precision that comes
from casting Rational(1/3) to BigDecimal.
2017-01-22 10:28:01 -05:00
..
active_model Make BigDecimal casting consistent on different platforms 2017-01-22 10:28:01 -05:00
active_model.rb [ci skip] Update Active Model copyright years. 2016-12-31 17:38:13 +01:00