Add lifecycle_state to Round model#14154
Conversation
|
|
||
| has_many :sibling_rounds, through: :competition_event, source: :rounds | ||
|
|
||
| enum :lifecycle_state, { pending: "pending", open: "open", locked: "locked", done: "done" }, prefix: true |
There was a problem hiding this comment.
What's the precise difference between locked and done?
There was a problem hiding this comment.
Your previous approach had ready, this new approach doesn't... What is the difference in design?
There was a problem hiding this comment.
ready is a dynamic property, so I had to move it out of the lifecycle state. Otherwise we would need to update the lifecycle state of the next round in the update_live_results_job, only if adding that live result would make the next round ready and we wanted to get rid of this next round checking shenanigans
There was a problem hiding this comment.
locked = next round is open, results can still be edited. done = results are posted, results can no longer be edited
Co-authored-by: Gregor Billing <gregor.billing.dev@gmail.com>
Co-authored-by: Gregor Billing <gregor.billing.dev@gmail.com>
|
Does my explanation and the test help why ready is needed? |
Does not remove
locked_by_idyet because that is required by the backfilling. The migration is also crazy inefficient right now as 99.99% of rounds will be just "done" as a state (it actually has not finished running on my laptop yet).Maybe we just say every round with results submitted is done and otherwise pending? Should cover our bases if every competition using ILR is either done or submitted right now