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 if_update option for conditionally updating counter in after_update hook. #15

Merged
merged 4 commits into from
Mar 16, 2014

Conversation

joe1chen
Copy link

This pull builds on top of the conditional update functionality. It allows updates to the counter to be made when an update has been made to an embedded/referenced object.

Without this pull, the conditional code is sort of incomplete since you will have to manually increment/decrement the counter when you update the field in the embedded/referenced object that the :if condition depends on.

See the new specs I've added - "should increase counter when old unpublished review is published" and "should decrease counter when old published review is unpublished".

@jah2488
Copy link
Owner

jah2488 commented Mar 16, 2014

Looks good. Thanks for this!

jah2488 added a commit that referenced this pull request Mar 16, 2014
Add if_update option for conditionally updating counter in after_update hook.
@jah2488 jah2488 merged commit b93b7d7 into jah2488:master Mar 16, 2014
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.

2 participants