Closed jon-sully closed 1 year ago
Patch coverage: 100.00
% and no project coverage change.
Comparison is base (
30bf0ca
) 98.64% compared to head (5a4c030
) 98.64%.:exclamation: Current head 5a4c030 differs from pull request most recent head b501bb9. Consider uploading reports for the commit b501bb9 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
speccccssss; also could check ended?
maybe we should update_columns to avoid the callbacks.
wdyt
π sorry for the specs lacking! Felt like this one was tiny!
update_columns
could work but I guess I'd ask the question "if someone ends a campaign and then calls end!
again later, would they want the latest ended_at
date? Or the date it was first (and really) 'ended'?" I'd probably guess that subsequent calls to .end!
on an already-ended subscription should be no-ops more than re-set the ended_at
π€
Checking ended?
is better than just doing !!ended_at
β good call π
EDIT: I also write these micro-PRs directly from GH so I'll write specs hoping they pass in CI π
Ran into a little infinite loop when calling
cs.end!
from inside anon_complete
block:Since calling
.end!
calls.update!
inside of it, which will then trigger theafter_commit
and thus back into theon_complete
block ^ and the cycle executes again ad infinitum!I figured this was a graceful way to avoid the
after_commit
callback if the thing is already ended! WDYT?