-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
I'm doing prop_transformer to maintain naming conventions between React and Rails:
inertia_config prop_transformer: ->(props:) do
# We need to parse to JSON and parse back to force ActiveRecord::Base instances to be serialized
# otherwise `deep_transform_keys` won't work on their attributes
serialized_props = JSON.parse(props.to_json, symbolize_names: true)
serialized_props.deep_transform_keys { |key| key.to_s.camelize(:lower) }
endI'm seeing an issue now with merge and deep merge functionality. The deep merge response result comes with snake_case while the prop is camelCase:

I was wondering if we could expose a similar feature as prop_transformer to expose a transformer for the merges. Or, is there a better way to solve this inconsistency?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels