We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2762407 + 2399603 commit da795a6Copy full SHA for da795a6
activerecord/test/cases/validations/numericality_validation_test.rb
@@ -111,9 +111,10 @@ def test_virtual_attribute_with_precision_round_half_even
111
112
subject = model_class.new(virtual_decimal_number: 123.455)
113
114
- if RUBY_VERSION > "3.0.0"
+ if 123.455.to_d(5) == BigDecimal("123.46")
115
# BigDecimal's to_d behavior changed in BigDecimal 3.0.1, see https://github.com/ruby/bigdecimal/issues/70
116
- # TODO: replace this with a check against BigDecimal::VERSION
+ # TODO: replace this with a check against BigDecimal::VERSION, currently
117
+ # we just check the behaviour because both versions of BigDecimal report "3.0.0"
118
assert_not_predicate subject, :valid?
119
else
120
assert_predicate subject, :valid?
0 commit comments