mirror of https://github.com/rails/rails
Merge pull request #41858 from jhawthorn/fix_build
Fix build on Ruby 3.0.1
This commit is contained in:
commit
da795a678b
|
@ -111,9 +111,10 @@ class NumericalityValidationTest < ActiveRecord::TestCase
|
|||
|
||||
subject = model_class.new(virtual_decimal_number: 123.455)
|
||||
|
||||
if RUBY_VERSION > "3.0.0"
|
||||
if 123.455.to_d(5) == BigDecimal("123.46")
|
||||
# BigDecimal's to_d behavior changed in BigDecimal 3.0.1, see https://github.com/ruby/bigdecimal/issues/70
|
||||
# TODO: replace this with a check against BigDecimal::VERSION
|
||||
# TODO: replace this with a check against BigDecimal::VERSION, currently
|
||||
# we just check the behaviour because both versions of BigDecimal report "3.0.0"
|
||||
assert_not_predicate subject, :valid?
|
||||
else
|
||||
assert_predicate subject, :valid?
|
||||
|
|
Loading…
Reference in New Issue