You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some past rounds are currently invalid in the database because the preferred_formats has changed over time (from mo3 - aka m - to ao5 - aka a).
This has some annoying consequences, for instance when editing a past competition's events and rounds information: if one of the round is invalid because of this, any change (even if unrelated) can't go through because the overall validation fails.
Since editing past competitions doesn't happen every day, and we can also workaround it, this is not a super urgent fix; but on the long term it would be nice to have a mapping event_id,date => list_of_allowed_formats.
It's not that straightforward to implement cleanly.
One alternative would be to have tables with event_id,format,start_date,end_date and do the math, but it seems overly complicated for something which almost never changes.
An easier approach could be to just hardcode the format id allowed in our event model, ie something like:
# in the Event modeldefpreferred_formats(at_date: Time.now)# some big switch case based on date end
The question with that approach is: how often in our codebase do we rely on the preferred_formats table, and can't we simply get rid of it?
(I haven't taken a look at that)
When we have a way to check the format based on an event and a date, we can just update the round validation to pass down the competition's date it belongs to.
The text was updated successfully, but these errors were encountered:
Some past rounds are currently invalid in the database because the
preferred_formats
has changed over time (from mo3 - akam
- to ao5 - akaa
).This has some annoying consequences, for instance when editing a past competition's events and rounds information: if one of the round is invalid because of this, any change (even if unrelated) can't go through because the overall validation fails.
Since editing past competitions doesn't happen every day, and we can also workaround it, this is not a super urgent fix; but on the long term it would be nice to have a mapping
event_id,date
=>list_of_allowed_formats
.It's not that straightforward to implement cleanly.
One alternative would be to have tables with
event_id,format,start_date,end_date
and do the math, but it seems overly complicated for something which almost never changes.An easier approach could be to just hardcode the format id allowed in our event model, ie something like:
The question with that approach is: how often in our codebase do we rely on the
preferred_formats
table, and can't we simply get rid of it?(I haven't taken a look at that)
When we have a way to check the format based on an event and a date, we can just update the round validation to pass down the competition's date it belongs to.
The text was updated successfully, but these errors were encountered: