diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-12-21 17:58:57 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-21 17:58:57 +0900 |
commit | 5abe612b0d3ef2b71c779b299a37e996882efe28 (patch) | |
tree | 8783e6f8c9ab0644e03f5926ecc869f6c40d3efb /activesupport/lib | |
parent | 721e26767c0443e63e67f4307415f5e4a8f3cd3d (diff) | |
parent | d5f8486d3f861f9848f4cd919fcdc33fe9f43dca (diff) | |
download | rails-5abe612b0d3ef2b71c779b299a37e996882efe28.tar.gz rails-5abe612b0d3ef2b71c779b299a37e996882efe28.tar.bz2 rails-5abe612b0d3ef2b71c779b299a37e996882efe28.zip |
Merge pull request #34767 from y-yagi/fix_convert_string_to_bigdecimal
Use BigDecimal provided methods to convert String to BigDecimal
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/xml_mini.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index be298bf0a1..b5995d6fe9 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -68,11 +68,7 @@ module ActiveSupport "float" => Proc.new { |float| float.to_f }, "decimal" => Proc.new do |number| if String === number - begin - BigDecimal(number) - rescue ArgumentError - BigDecimal(number.to_f.to_s) - end + number.to_d else BigDecimal(number) end |