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

Update fragment cache to support namespaced objects #1060

Merged

Conversation

aaronlerch
Copy link
Contributor

The code to name the cached and uncached serializers didn't take into account namespaces in object names. This would exhibit itself with an error like: NameError: wrong constant name Spam::unrelatedLinkCachedSerializer.

The use of .capitalize didn't take all the scenarios into account. Since the name being passed in is already from an existing class name (serializer.object.class.name) there is no need to capitalize the value, instead I just did a simple string replacement for :: namespace delimiters into _s.

@joaomdmoura
Copy link
Member

👍 LGTM, a great catch

joaomdmoura added a commit that referenced this pull request Aug 18, 2015
Update fragment cache to support namespaced objects
@joaomdmoura joaomdmoura merged commit e7d3323 into rails-api:master Aug 18, 2015
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