-
Notifications
You must be signed in to change notification settings - Fork 195
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 Rails 5 sash validation fail because of required belong_to #266
Conversation
@@ -7,7 +7,7 @@ def has_merit(options = {}) | |||
# That's why MeritableModel belongs_to Sash. Can't use | |||
# dependent: destroy as it may raise FK constraint exceptions. See: | |||
# https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1079-belongs_to-dependent-destroy-should-destroy-self-before-assocation | |||
belongs_to :sash, class_name: 'Merit::Sash', inverse_of: nil | |||
belongs_to :sash, class_name: 'Merit::Sash', inverse_of: nil, optional: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [82/80]
Looking good! This will need a conditional for the Rails major version, though. Can you please add
We should address that, and have it tested. Thanks! |
Also, a regression spec for your failing |
Will do! |
ping @tamycova. Thanks! |
If you need help, please share your questions and I'll do my best. |
I'm having the same issue here, how do I implement the fix? Or when is the update comming? :) |
This works only in Rails 5. You can freely use this branch in your project and it will work.
When someone invests the time to make merit work with both versions, and tests both versions in Travis. Then I'll release it. Thanks! |
Hi,
I'm very sorry to ask you this but how do I know the name of the branch? :p
I tried this but no succes: gem 'merit', :branch =>
'f657596409d98fc7c8e3274b213b86cc47d87495'
Grts ,
Louis
2016-12-04 20:59 GMT+01:00 Tute Costa <notifications@github.com>:
… I'm having the same issue here, how do I implement the fix?
This works only in Rails 5. You can freely use this branch in your project
and it will work.
Or when is the update comming? :)
When someone invests the time to make merit work with both versions, and
tests both versions in Travis. Then I'll release it.
Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#266 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ARN9J74GItR8B4cgZ8gGIdke86q-wNU1ks5rExutgaJpZM4Ko4B0>
.
--
Louis De Beule
Division VZW
GSM: +32 494 84 68 28
|
You could do |
I find it surprising, but it looks like CI is passing for Rails 5: https://travis-ci.org/merit-gem/merit/builds/159191419. Closing this issue, but if it continues to be a problem we reopen. |
Hello, I'm having the same issue, using the fix in this PR did fix the issue, I am not sure as I didn't read through the whole test code, but the reason the CI is passing on Rails 5 without that patch is because that precise use case (creating a basic user with |
On Rails 5, doing Thanks! |
@tute I'm getting the |
I just tested against @tamycova's update and it fixes the issue. |
I have the same issue with Rails 5 and This might not be the preferred solution, but for some it might also be possible that they set the following config to false to have the same behavior that was default in Rails 4: |
I have tried all your ways but I still have error, what should I do? |
#265
It fails when I use
rake
to test, but works on my Rails 5 app. Also the line is over 80 characters but wasn't sure how do you prefer to break the line.