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

NoMethodError: undefined method `compact' #27

Open
did opened this issue Nov 14, 2013 · 1 comment
Open

NoMethodError: undefined method `compact' #27

did opened this issue Nov 14, 2013 · 1 comment
Assignees

Comments

@did
Copy link
Member

did commented Nov 14, 2013

It happens when you've got 2 fields: belongs_to + many_to_many in a same model.

The problem is that we don't set the inverse_of property of a belongs_to field but we have to in order to avoid that error.

Better explanation here:
https://github.com/mongoid/mongoid/issues/1434

@ghost ghost assigned did Nov 14, 2013
@rpocklin
Copy link

This makes sense and fixed the exact problem I had, but i'm wondering why this is conditionally optional, would it be less surprising just to ask for the inverse_of on belongs_to to always be defined explicitly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants