diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-02-20 09:36:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-20 09:36:40 +0100 |
commit | 71da39097b67114329be6d8db7fe6911124531af (patch) | |
tree | f2caf42ba1e673f21c498ab15a005cba015cf2fc /activesupport/lib | |
parent | 41c33bd4b2ec3f4a482e6030b6fda15091d81e4a (diff) | |
parent | e532531939a610c3a1ba4594d325b10a0c9b4546 (diff) | |
download | rails-71da39097b67114329be6d8db7fe6911124531af.tar.gz rails-71da39097b67114329be6d8db7fe6911124531af.tar.bz2 rails-71da39097b67114329be6d8db7fe6911124531af.zip |
Merge pull request #27925 from robin850/hwia-removal
Remove the top-level `HashWithIndifferentAccess` contant
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 18 |
1 files changed, 17 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 79e7feaf47..8638667082 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -316,4 +316,20 @@ module ActiveSupport end end -HashWithIndifferentAccess = ActiveSupport::HashWithIndifferentAccess +class HashWithIndifferentAccess < ActiveSupport::HashWithIndifferentAccess + def initialize(*) + ActiveSupport::Deprecation.warn "HashWithIndifferentAccess is deprecated!" \ + "Use ActiveSupport::HashWithIndifferentAccess instead." + super + end + + def self.inherited(*) + ActiveSupport::Deprecation.warn "HashWithIndifferentAccess is deprecated!" \ + "Use ActiveSupport::HashWithIndifferentAccess instead." + super + end + + def encode_with(coder) + coder.represent_object(nil, ActiveSupport::HashWithIndifferentAccess.new(self)) + end +end |