-
Couldn't load subscription status.
- Fork 808
Validate .update method #289
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
Conversation
This makes sense! Apologies for the ridiculous delay, you should have pinged me!
If you still have time & energy for the patch, can you please update it:
- There's been a
:validateoption introduced in 1fd6c0b, can we play with it? - Can you please add a unit test for this?
1c4a72e to
768ff58
Compare
Follow rails convention by returning false unless the item is valid.
768ff58 to
8901130
Compare
Updated with :validate option and unit tests. Please let me know if you have any questions, comments or concerns.
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.
Have you run the test? subject.expects(:persisted?).returns(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.
Test suite of this project has never worked for me sadly so I haven't been able to outside of Travis CI
Fixed the tests in b660d6a and merged.
dgmora
commented
Jan 17, 2017
Unless I'm miss understanding something, this is not fixing the important cases.
If you have stored a valid model, and then update with an invalid attribute, valid? will be true, as the model has yet not been changed, and there won't be validation
Follow rails convention by returning false unless the item is valid.