Drop dead reverse_merge require; call HWIA constructor directly#2733
Open
ericproulx wants to merge 1 commit into
Open
Drop dead reverse_merge require; call HWIA constructor directly#2733ericproulx wants to merge 1 commit into
ericproulx wants to merge 1 commit into
Conversation
…ectly
Removes the now-dead `active_support/core_ext/hash/reverse_merge`
require and replaces the two `reverse_merge` usages with explicit
`{ defaults }.merge!(other)` literals.
Also swaps `.with_indifferent_access` call sites for
`ActiveSupport::HashWithIndifferentAccess.new(...)` and adds an
explicit `require 'active_support/hash_with_indifferent_access'` so
the class dependency is documented at the top of `lib/grape.rb`
rather than implicit via the core_ext.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
320602c to
069d584
Compare
Danger ReportWarnings
MarkdownsHere's an example of a CHANGELOG.md entry: * [#2733](https://github.com/ruby-grape/grape/pull/2733): Drop dead reverse_merge require; call hwia constructor directly - [@ericproulx](https://github.com/ericproulx). |
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.
Summary
active_support/core_ext/hash/reverse_mergerequire (no remaining call sites inlib/); the tworeverse_mergeusages become explicit{ defaults }.merge!(other)literals..with_indifferent_accesscall sites forActiveSupport::HashWithIndifferentAccess.new(...)and adds an explicitrequire 'active_support/hash_with_indifferent_access', so the class dependency is documented at the top oflib/grape.rbrather than implicit via the core_ext. Thecore_ext/hash/indifferent_accessrequire is intentionally kept —HWIA#convert_valueinvokesHash#nested_under_indifferent_accessinternally when wrapping nested hash values.No behavior change; same semantics in all touched paths.
Test plan
bundle exec rspec spec/grape/params_builder spec/grape/middleware spec/grape/util/registry_spec.rb spec/grape/endpoint_spec.rb spec/grape/request_spec.rb(488 examples, 0 failures)🤖 Generated with Claude Code