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

Gem is loaded before rails environment and it overrides the ActiveSupport #stringify_keys #56

Open
m-hukic opened this issue May 7, 2024 · 1 comment

Comments

@m-hukic
Copy link
Contributor

m-hukic commented May 7, 2024

Hello! Since it looks like this gem is not dependent on rails gem it gets loaded before the rails and overrides the default #stringify_keys method from rails which is causing very weird and almost untraceable issues especially in test environment!

Can we please add that dependency and ensure that it's not just overriding rails default behaviour or remove this monkey patch and switch to using #transform_keys(&:to_s) and #trasnform_values in one place where it's being used in the SDK. Here: https://github.com/livekit/server-sdk-ruby/blob/main/lib/livekit/grants.rb#L91

Using refinement should also limit the scope of the change of #stringify_keys

@m-hukic
Copy link
Contributor Author

m-hukic commented May 7, 2024

I've opened a PR #57 not sure if this would be acceptable solution to everyone there should be no functionality change to the gem 😄

davidzhao pushed a commit that referenced this issue May 8, 2024
* remove monkey patch and add some tests for grants class

* use different approach with refine and make sure to address nested keys
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

No branches or pull requests

1 participant