Cleanup Active Support core extensions#1757
Merged
neilvcarvalho merged 1 commit intomainfrom Jul 18, 2025
Merged
Conversation
We're not using the `Hash#except!` method defined on `active_support/core_ext/hash/except.rb`, nor are using `Hash#with_indifferent_access` defined on `active_support/hash_with_indifferent_access.rb`.
c615da7 to
8569c8e
Compare
core_ext paths
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up unnecessary Active Support core extension requires and optimizes the remaining ones. The changes remove unused hash method extensions and update a require statement to load only the specific class needed rather than core extensions.
- Removes unused
Hash#except!method requirement from evaluator.rb - Replaces
Hash#with_indifferent_accesscore extension with directHashWithIndifferentAccessclass requirement in registry.rb
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/factory_bot/registry.rb | Updates require to load HashWithIndifferentAccess class directly instead of core extension |
| lib/factory_bot/evaluator.rb | Removes unused Hash#except core extension requirement |
Member
Author
|
I'm merging right away since this is a safe change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewing the Active Support usage, I noticed two
requirecalls that are unnecessary:We don't use the
Hash#except!method defined onactive_support/core_ext/hash/except.rb, nor theHash#with_indifferent_accessdefined onactive_support/hash_with_indifferent_access.rb.We do use the
HashWithIndifferentAccessclass directly, so we're now requiring"active_support/hash_with_indifferent_access"instead.