Historically we've had a separation between Event—the model that contains the event time and recurrence information—and an "eventable"—a polymorphic model that could only be ShiftEvent. This model links the Event to the Shift, and all it's users, tasks, notes, etc.
I think the original creators were thinking there might be other types of events you could have that aren't shifts. But we don't have that, or any plans for that, and it's adding complexity that we don't need.
This collapses everything from shift_event onto event. Shift is the overarching model that groups every related event. There are multiple events (currently, and maybe forever) needed to differentiate occurrences of a recurring event that have different titles, volunteers, tasks, etc, but are otherwise the same shift. E.g. there are both part of the same shift:
- Picking up from Local Grocery at 2pm on Tuesdays
- Picking up from Local Grocery at 3pm on Tuesday, Nov 4th (one-off exception)
Now these events will have a direct reference to that shift instead of going through the ShiftEvent model.
Review notes
This is quite large, sorry about that. I could not figure out a way to shrink it in a way that let me keep shipping. I did try to make each commit one type of change though. You should be able to load up a commit, figure out the pattern, and scroll through it quickly. Hopefully that helps. If there are other things that would help in the future, I'd love to do that for y'all. I'm also happy to pair and walk through any of these changes.
Historically we've had a separation between `Event`—the model that contains the event time and recurrence information—and an "eventable"—a polymorphic model that could only be `ShiftEvent`. This model links the `Event` to the `Shift`, and all it's users, tasks, notes, etc.
I think the original creators were thinking there might be other types of events you could have that aren't shifts. But we don't have that, or any plans for that, and it's adding complexity that we don't need.
This collapses everything from shift_event onto event. Shift is the overarching model that groups every related event. There are multiple events (currently, and maybe forever) needed to differentiate occurrences of a recurring event that have different titles, volunteers, tasks, etc, but are otherwise the same shift. E.g. there are both part of the same shift:
- Picking up from Local Grocery at 2pm on Tuesdays
- Picking up from Local Grocery at 3pm on Tuesday, Nov 4th (one-off exception)
Now these events will have a direct reference to that shift instead of going through the `ShiftEvent` model.
---
## Review notes
This is quite large, sorry about that. I could not figure out a way to shrink it in a way that let me keep shipping. I did try to make each commit one _type_ of change though. You should be able to load up a commit, figure out the pattern, and scroll through it quickly. Hopefully that helps. If there are other things that would help in the future, I'd love to do that for y'all. I'm also happy to pair and walk through any of these changes.