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 in resource creation form with belongs_to attribute #27

Closed
gabriel-cardoso opened this issue Jan 26, 2015 · 1 comment · Fixed by #28
Closed

NoMethodError in resource creation form with belongs_to attribute #27

gabriel-cardoso opened this issue Jan 26, 2015 · 1 comment · Fixed by #28

Comments

@gabriel-cardoso
Copy link
Contributor

In belongs_to.rb at line 7

undefined methodforeign_key' for nil:NilClass`

@vala
Copy link
Contributor

vala commented Jan 27, 2015

@gabriel-cardoso This means that ModelFieldParsers::Relations added a BelongsTo field to your model but the model can't find the relation with the given name. Since relations are fetched from the same ActiveRecord::Base.reflections hash when creating the BelongsTo field than the one used when trying to fetch the relation from inside the field class, there's something happening that I can't guess from the information that you gave to me

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 a pull request may close this issue.

2 participants