From 4ba5386e6c647b285490b0a9f44fcf617daeda41 Mon Sep 17 00:00:00 2001 From: Nick Weiland Date: Wed, 31 Oct 2018 22:58:32 -0700 Subject: Make #to_options an alias for #symbolize_keys Fixes #34359 Prior to 5.2.0 (2cad8d7), HashWithIndifferentAccess#to_options acted as an alias to HashWithIndifferentAccess#symbolize_keys. Now, #to_options returns an instance of HashWithIndifferentAccess while #symbolize_keys returns and instance of Hash. This pr makes it so HashWithIndifferentAccess#to_options acts as an alias for HashWithIndifferentAccess#symbolize_keys once again. --- activesupport/test/hash_with_indifferent_access_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/hash_with_indifferent_access_test.rb b/activesupport/test/hash_with_indifferent_access_test.rb index af67ed21c8..f81e0dc70f 100644 --- a/activesupport/test/hash_with_indifferent_access_test.rb +++ b/activesupport/test/hash_with_indifferent_access_test.rb @@ -57,6 +57,13 @@ class HashWithIndifferentAccessTest < ActiveSupport::TestCase assert_equal @symbols, @mixed.with_indifferent_access.symbolize_keys end + def test_to_options_for_hash_with_indifferent_access + assert_instance_of Hash, @symbols.with_indifferent_access.to_options + assert_equal @symbols, @symbols.with_indifferent_access.to_options + assert_equal @symbols, @strings.with_indifferent_access.to_options + assert_equal @symbols, @mixed.with_indifferent_access.to_options + end + def test_deep_symbolize_keys_for_hash_with_indifferent_access assert_instance_of Hash, @nested_symbols.with_indifferent_access.deep_symbolize_keys assert_equal @nested_symbols, @nested_symbols.with_indifferent_access.deep_symbolize_keys -- cgit v1.2.3