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

Adding in a new after_completed callback #544

Merged
merged 1 commit into from
Nov 25, 2020
Merged

Adding in a new after_completed callback #544

merged 1 commit into from
Nov 25, 2020

Conversation

jwoertink
Copy link
Member

Fixes #432

Also see comment: #481 (comment)

This is a new callback added for SaveOperation that will run after commits, but this also runs even if no changes are happening to the record. As where after_commit only runs if an actual DB commit happens, after_completed will run even when there's no changes to be made.

Naming is hard, so I'm down for a different name. I also thought about calling it after_finalized or after_succesful_run.

Another option I toyed with was doing after_validated; however, I felt that a name like that would imply that it would run after the valid? calls... This would allow us to call in both spots, but the original issue for #432 wanted to run things after stuff was saved, and that would not be the case here 🤔

Copy link
Member

@matthewmcgarvey matthewmcgarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

@jwoertink jwoertink merged commit 5f22eed into master Nov 25, 2020
@jwoertink jwoertink deleted the issues/432 branch November 25, 2020 16:04
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.

Callbacks do not run if no column attribute changed
2 participants