Skip to content

Conversation

@tcannonfodder
Copy link
Contributor

@tcannonfodder tcannonfodder commented Aug 18, 2025

  • In order to play nicely with ActionController::Parameters, which does not have a with_indifferent_access, we need to make sure to:
    • Call to_h (we are always expecting some sort of hash as original_attributes_hash)
    • Then call with_indifferent_access, to normalize it to indifferent access (ActionController::Parameters#to_h does this automatically, but if a regular hash is provided, we still need to convert it to indifferent access)

This closes #3

* In order to play nicely with `ActionController::Parameters`, which
	does not have a `with_indifferent_access`, we need to make sure to:
	* Call `to_h` (we are always expecting some sort of hash as
		`original_attributes_hash`)
	* Then call `with_indifferent_access`, to normalize it to
		indifferent access (`ActionController::Parameters#to_h` does this
		automatically, but if a regular hash is provided, we still need to
		convert it to indifferent access)
@tcannonfodder tcannonfodder merged commit eac4c3a into main Aug 18, 2025
1 check passed
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.

fallback_to_model_values should call to_h if given an ActionController::Parameters

2 participants