Skip to content

Commit

Permalink
Merge pull request rails#48187 from juanmanuelramallo/support-string-…
Browse files Browse the repository at this point in the history
…keys-in-inheritable-options

[Documentation] ActiveSupport::InheritableOptions with string keys [ci-skip]
  • Loading branch information
jonathanhefner authored May 10, 2023
2 parents 8d56a0e + 1a63f94 commit a792a62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions activesupport/lib/active_support/ordered_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ def inspect
# h = ActiveSupport::InheritableOptions.new({ girl: 'Mary', boy: 'John' })
# h.girl # => 'Mary'
# h.boy # => 'John'
#
# If the existing hash has string keys, call Hash#symbolize_keys on it.
#
# h = ActiveSupport::InheritableOptions.new({ 'girl' => 'Mary', 'boy' => 'John' }.symbolize_keys)
# h.girl # => 'Mary'
# h.boy # => 'John'
class InheritableOptions < OrderedOptions
def initialize(parent = nil)
if parent.kind_of?(OrderedOptions)
Expand Down

0 comments on commit a792a62

Please sign in to comment.