Skip to content

Drop dead reverse_merge require; call HWIA constructor directly#2733

Open
ericproulx wants to merge 1 commit into
masterfrom
refactor/drop-indifferent-and-reverse-merge-requires
Open

Drop dead reverse_merge require; call HWIA constructor directly#2733
ericproulx wants to merge 1 commit into
masterfrom
refactor/drop-indifferent-and-reverse-merge-requires

Conversation

@ericproulx
Copy link
Copy Markdown
Contributor

Summary

  • Removes the now-dead active_support/core_ext/hash/reverse_merge require (no remaining call sites in lib/); the two reverse_merge usages become explicit { defaults }.merge!(other) literals.
  • 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. The core_ext/hash/indifferent_access require is intentionally kept — HWIA#convert_value invokes Hash#nested_under_indifferent_access internally 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

…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>
@ericproulx ericproulx force-pushed the refactor/drop-indifferent-and-reverse-merge-requires branch from 320602c to 069d584 Compare May 20, 2026 09:08
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Danger Report

Warnings

  • Unless you're refactoring existing code or improving documentation, please update CHANGELOG.md.

Markdowns

Here'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).

View run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant