File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
activerecord/test/cases/validations Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,9 @@ def test_virtual_attribute_with_precision_round_half_even
112
112
113
113
subject = model_class . new ( virtual_decimal_number : 123.455 )
114
114
115
- if 123.455 . to_d ( 5 ) == BigDecimal ( "123.46" )
116
- # BigDecimal's to_d behavior changed in BigDecimal 3.0.1, see https://github.com/ruby/bigdecimal/issues/70
117
- # TODO: replace this with a check against BigDecimal::VERSION, currently
118
- # we just check the behavior because both versions of BigDecimal report "3.0.0"
119
- assert_not_predicate subject , :valid?
120
- else
121
- assert_predicate subject , :valid?
122
- end
115
+ # BigDecimal's to_d behavior changed in BigDecimal 3.1.0, see https://github.com/ruby/bigdecimal/issues/70
116
+ # Since BigDecimal 3.1.4 or higher is installed as an Active Support dependency, we just check the behavior of BigDecimal 3.1.0+.
117
+ assert_not_predicate subject , :valid?
123
118
end
124
119
125
120
def test_virtual_attribute_with_precision_round_up
You can’t perform that action at this time.
0 commit comments