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

Add a simple spec for validating presence of an _order field. #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yaymukund
Copy link

This is the same issue as #51, but I've added a breaking test.

Basically, before_save :handle_ranking gets run only after the validation throws the error. This is because validation callbacks happen first:

screen shot 2014-03-02 at 11 59 47 pm

@yaymukund
Copy link
Author

Unfortunately, I'm not sure how to fix this without breaking a bunch of other specs. Maybe you can defer validations on ranking columns until handle_ranking has been run. I'm not sure.

@mixonic
Copy link
Contributor

mixonic commented Mar 3, 2014

Or run the ranking before_validation instead of before_create?

@yaymukund
Copy link
Author

I tried exactly that. It breaks a bunch of specs, though I didn't dig in too much.

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 this pull request may close these issues.

None yet

2 participants