diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-12-13 18:08:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 18:08:46 -0500 |
commit | 6464683cee8c8752561020f69f6ea5722e98376f (patch) | |
tree | 167d55c5ddb4663bd24355ac5e179bc7f4dd635c /activerecord/lib | |
parent | 924267516723b4cb69be64de456f8552e5ed55e6 (diff) | |
parent | 6c6c3fa166975e5aebbe444605d736909e9eb75b (diff) | |
download | rails-6464683cee8c8752561020f69f6ea5722e98376f.tar.gz rails-6464683cee8c8752561020f69f6ea5722e98376f.tar.bz2 rails-6464683cee8c8752561020f69f6ea5722e98376f.zip |
Merge pull request #31435 from yahonda/deprecated_bigdecimal_new
Suppress `warning: BigDecimal.new is deprecated` in activerecord
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attributes.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attributes.rb b/activerecord/lib/active_record/attributes.rb index 0b7c9398a8..35150889d9 100644 --- a/activerecord/lib/active_record/attributes.rb +++ b/activerecord/lib/active_record/attributes.rb @@ -57,7 +57,7 @@ module ActiveRecord # store_listing = StoreListing.new(price_in_cents: '10.1') # # # before - # store_listing.price_in_cents # => BigDecimal.new(10.1) + # store_listing.price_in_cents # => BigDecimal(10.1) # # class StoreListing < ActiveRecord::Base # attribute :price_in_cents, :integer diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb index 879dba7afd..e7d33855c4 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb @@ -6,7 +6,7 @@ module ActiveRecord module OID # :nodoc: class Decimal < Type::Decimal # :nodoc: def infinity(options = {}) - BigDecimal.new("Infinity") * (options[:negative] ? -1 : 1) + BigDecimal("Infinity") * (options[:negative] ? -1 : 1) end end end |