Skip to content

Preserve class-level respond_to options - #259

Open
OskarEichler wants to merge 1 commit into
heartcombo:mainfrom
OskarEichler:codex/preserve-respond-to-options
Open

OskarEichler wants to merge 1 commit into
heartcombo:mainfrom
OskarEichler:codex/preserve-respond-to-options

Conversation

@OskarEichler

Copy link
Copy Markdown

ActionController::RespondWith::ClassMethods#respond_to deletes :only and :except from the caller-owned options hash. Reusing that hash observes it emptied, while passing a frozen hash raises FrozenError.

Duplicate the extracted options before normalizing them. Literal-call behavior is unchanged.

Verification:

  • Mutable-options model retains the original hash.
  • Frozen-options model no longer raises.
  • Existing suite: 116 runs / 291 assertions, zero failures/errors.
  • RuboCop passes.

No test files were modified.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant