-
Notifications
You must be signed in to change notification settings - Fork 194
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
Rails 5 required belongs_to makes sash relation fail #265
Comments
A User should create its Sash if it doesn't exist. |
Thanks @tute for the quick reply, this is how I seed: Edit: Also, what about the controller on user#create? (I am using devise) |
This is the code that initializes a sash if it doesn't exist: https://github.com/merit-gem/merit/blob/master/lib/merit/model_additions.rb#L46-L56. I don't see why an application would need to manually create the sash. Is this code you run in the console? If not, can you paste the file that contains that line? Can you paste your Thanks! |
Thanks! And forgot to ask, what version of merit are you using? |
2.4 and rails 5, if having access to my app would help let me know! |
Aww this is biting us: http://blog.bigbinary.com/2016/02/15/rails-5-makes-belong-to-association-required-by-default.html Not sure how to fix right now, but that's the source of this bug in merit. Thanks for reporting! |
If it doesn't fail on previous versions of Rails, adding |
Nice! I will figure it out in a while (have to leave now) and let you know how it goes! |
Adding
I think it may be a version problem? |
Not sure. Is that the whole stacktrace you get? You can also send a Pull Request, even if it's failing, so we inspect this in the Continuos Integration (Travis CI). |
Closing in favor of Pull Request. Thanks! |
@tute .. I see that pull request is closed ... so whats the solution of |
@nikhilgoyal22 try the changes in this PR #287 |
@redtachyons but what should I use in my gemfile |
@nikhilgoyal22 Add this in Gemfile and check |
Hi!
I just added merit to my app, when I try to seed users I get ActiveRecord::RecordInvalid: Validation failed: Sash must exist, should I manually add a Sash id when I create an user, or where does this problem come from?
Thanks!
The text was updated successfully, but these errors were encountered: