aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-12-13 18:08:46 -0500
committerGitHub <noreply@github.com>2017-12-13 18:08:46 -0500
commit6464683cee8c8752561020f69f6ea5722e98376f (patch)
tree167d55c5ddb4663bd24355ac5e179bc7f4dd635c /activerecord/lib
parent924267516723b4cb69be64de456f8552e5ed55e6 (diff)
parent6c6c3fa166975e5aebbe444605d736909e9eb75b (diff)
downloadrails-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.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb2
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