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

Merchant Iteration 6: Rails 5 makes belongs_to association required by default #1218

Open
MikeyParton opened this issue Aug 25, 2016 · 0 comments

Comments

@MikeyParton
Copy link

With Rails 5, you have to explicitly declare belongs_to :user, optional: true
in /models/order.rb

Otherwise, you will get this error when you try to create an order while not logged in
ActiveRecord::RecordInvalid (Validation failed: User must exist):

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