diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-17 13:48:26 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-17 13:48:26 -0300 |
commit | fd56b51f9bd9a472a464f7fb5ba40560156cd557 (patch) | |
tree | e4f2e0dd680bc261f9e898843e714ab9e6fd6e1e | |
parent | 8a80e3b6c446931330ad07130603712e8d0a2ff3 (diff) | |
parent | d43b1b0a9eb5bc46818224d0939223ea31a41b00 (diff) | |
download | rails-fd56b51f9bd9a472a464f7fb5ba40560156cd557.tar.gz rails-fd56b51f9bd9a472a464f7fb5ba40560156cd557.tar.bz2 rails-fd56b51f9bd9a472a464f7fb5ba40560156cd557.zip |
Merge pull request #17300 from claudiob/add-necessary-require-reverse-merge
Add necessary 'require reverse_merge' to HAWI.rb
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 1 | ||||
-rw-r--r-- | activesupport/test/hash_with_indifferent_access_test.rb | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 3d8f2d572b..1468c62151 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/hash/keys' +require 'active_support/core_ext/hash/reverse_merge' module ActiveSupport # Implements a hash where keys <tt>:foo</tt> and <tt>"foo"</tt> are considered diff --git a/activesupport/test/hash_with_indifferent_access_test.rb b/activesupport/test/hash_with_indifferent_access_test.rb new file mode 100644 index 0000000000..843994147b --- /dev/null +++ b/activesupport/test/hash_with_indifferent_access_test.rb @@ -0,0 +1,10 @@ +require 'abstract_unit' +require 'active_support/hash_with_indifferent_access' + +class HashWithIndifferentAccessTest < ActiveSupport::TestCase + def test_reverse_merge + hash = HashWithIndifferentAccess.new key: :old_value + hash.reverse_merge! key: :new_value + assert_equal :old_value, hash[:key] + end +end
\ No newline at end of file |