Allow deprecated non-symbol access to nested
Before that change, nested hashes returned from
This is a breaking change for any app that might be relying on the nested hashes returned from
This PR introduces a temporary
This way, any apps that are still relying on the ability to access these nested hashes using non-symbol keys will be able to observe the deprecation notices and have time to implement fixes before non-symbol access is removed for good.
Note that the top-level access to the
The deprecation is only for nested keys below the top-level, since that is the functionality that is potentially broken.
The text was updated successfully, but these errors were encountered:
I think I've addressed all PR comments and squashed my commits, so this PR should be ready to go if there are no more comments.
Additionally, I've added an extra commit to fix the order of expected/actual parameters of some of the assertions added in #33882. Since that is logically separate from the main work in this PR, I've opted to leave that as a separate commit, and didn't squash it with my other commits.
A change to `Rails::Application.config_for` in rails#33815 and rails#33882 has altered the behaviour of the returned object in a breaking manner. Before that change, nested hashes returned from `config_for` could be accessed using non-symbol keys. After the change, all keys are recursively symbolized so non-symbol access fails to read the expected values. This is a breaking change for any app that might be relying on the nested hashes returned from `config_for` calls, and thus should be deprecated before being removed from the codebase. This commit introduces a temporary `NonSymbolAccessDeprecatedHash` class that recursively wraps any nested hashes inside the `OrderedOptions` object returned from `config_for` and issues a deprecation notice when a non-symbol based access is performed. This way, apps that are still relying on the ability to access these nested hashes using non-symbol keys will be able to observe the deprecation notices and have time to implement changes before non-symbol access is removed for good. A CHANGELOG entry is also added to note that non-symbol access to nested `config_for` hashes is deprecated.