aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-10-29 10:01:33 -0600
committerSean Griffin <sean@seantheprogrammer.com>2015-10-29 10:01:33 -0600
commit35085c9540b5f5b1423627b2e7a497adbc28e0b2 (patch)
treee49646db637319a0db37f217220bb70b06457099 /activesupport
parentddb886ef1338e0e4fa84d6d8ba55161da34d91aa (diff)
downloadrails-35085c9540b5f5b1423627b2e7a497adbc28e0b2.tar.gz
rails-35085c9540b5f5b1423627b2e7a497adbc28e0b2.tar.bz2
rails-35085c9540b5f5b1423627b2e7a497adbc28e0b2.zip
Deprecate `HWIDA.new_from_hash_copying_default`
This method was already niche, and is now redundant with `.new`
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb5
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 3edeeb0029..4ff35a45a1 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -77,6 +77,11 @@ module ActiveSupport
end
def self.new_from_hash_copying_default(hash)
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ `ActiveSupport::HashWithIndifferentAccess.new_from_hash_copying_default`
+ has been deprecated, and will be removed in Rails 5.1. The behavior of
+ this method is now identical to the behavior of `.new`.
+ MSG
new(hash)
end
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 1d9b56b1b4..265416dce7 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -1042,7 +1042,7 @@ class HashExtTest < ActiveSupport::TestCase
hash = Hash.new
hash.default_proc = proc { |h, k| raise "walrus" }
- assert_nothing_raised { HashWithIndifferentAccess.new_from_hash_copying_default(hash) }
+ assert_deprecated { HashWithIndifferentAccess.new_from_hash_copying_default(hash) }
end
def test_new_with_to_hash_conversion_copies_default