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/lib/active_support/hash_with_indifferent_access.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 2fac579469..f1af76019a 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -289,6 +289,7 @@ module ActiveSupport undef :symbolize_keys! undef :deep_symbolize_keys! def symbolize_keys; to_hash.symbolize_keys! end + alias_method :to_options, :symbolize_keys def deep_symbolize_keys; to_hash.deep_symbolize_keys! end def to_options!; self end -- cgit v1.2.3