Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional implementation details for key override #35

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

jho406
Copy link
Contributor

@jho406 jho406 commented Jul 30, 2024

This adds a helpful note to the change key format section in case someone REALLY wants to change the way keys are formatted.

This adds a helpful note to the change key format section in case someone
REALLY wants to change the way keys are formatted.
@jho406
Copy link
Contributor Author

jho406 commented Jul 30, 2024

@kortirso ☝️

@@ -607,7 +609,15 @@ Props::BaseWithExtensions.class_eval do
#
# -> { "firstValue" => "first", "secondValue" => "second" }
def key_format(key)
key.to_s.camelize(:lower)
@key_cache ||= {}
@key_cache[key] ||= key.to_s.camelize(:lower)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this will prevent multiple transformations of key? looks good

@jho406 jho406 merged commit f671628 into main Aug 2, 2024
24 checks 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.

2 participants