Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing require to hash_with_indifferent_access #41707

Conversation

okuramasafumi
Copy link
Contributor

Summary

When requiring only "active_support/hash_with_indifferent_access",
calling slice! method on HashWithIndifferentAccess object
causes NoMethodError.
This is caused by slice! method calls super which is defined
in "active_support/core_ext/hash/slice" that' not required by this file.
Adding require "active_support/core_ext/hash/slice" to hwia
resolves this issue.

Note: since all tests require_relative "abstract_unit" that requires
"active_support/core_ext/hash/slice" eventually, it's pretty hard to
test method behavior without require.

When requiring only "active_support/hash_with_indifferent_access",
calling `slice!` method on `HashWithIndifferentAccess` object
causes `NoMethodError`.
This is caused by `slice!` method calls `super` which is defined
in "active_support/core_ext/hash/slice" that' not required by this file.
Adding `require "active_support/core_ext/hash/slice"` to hwia
resolves this issue.

Note: since all tests `require_relative "abstract_unit"` that requires
"active_support/core_ext/hash/slice" eventually, it's pretty hard to
test method behavior without require.
@kamipo kamipo merged commit 1dcad65 into rails:main Mar 21, 2021
@okuramasafumi okuramasafumi deleted the add-missing-require-to-hash_with_indifferent_access branch March 21, 2021 06:28
kamipo added a commit that referenced this pull request Mar 22, 2021
…ash_with_indifferent_access

Add missing require to hash_with_indifferent_access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants