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

Fix has_many_nested for models in modules #125

Closed
wants to merge 2 commits into from

Conversation

mrGrazy
Copy link
Contributor

@mrGrazy mrGrazy commented Dec 11, 2018

The current implementation of many has_many_nested methods break when the model is in a namespace like this:

module ContentfulModels
  class Page < ContentfulModel::Base

  end
end

The problem is caused by use of to_s.underscore, which returns 'contentfulmodels/page' and breaks lots of variables.

I have fixed it by using to_s.demodulize.underscore.

I would like to add tests for this, but all the tests in this part of the code base seem to be failing with VCR errors that I can't fix without being able to recreate the test space.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@dlitvakb
Copy link
Contributor

dlitvakb commented May 9, 2019

Thanks!

This has been merged manually, therefore closing this PR.

Cheers

@dlitvakb dlitvakb closed this May 9, 2019
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.

None yet

2 participants