5
11
Fork
You've already forked tomato
1

Event points directly to Shift (drop ShiftEvent) #65

Merged
edwardloveall merged 46 commits from el-drop-shift-event into main 2025年12月29日 17:59:14 +01:00

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.
edwardloveall changed title from (削除) Event points directly to Shift (drop ShiftEvent) (削除ここまで) to WIP: Event points directly to Shift (drop ShiftEvent) 2025年12月18日 22:16:17 +01:00
edwardloveall force-pushed el-drop-shift-event from e00b6e7420
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
to 2f9307ab14
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
2025年12月18日 23:01:57 +01:00
Compare
edwardloveall changed title from (削除) WIP: Event points directly to Shift (drop ShiftEvent) (削除ここまで) to Event points directly to Shift (drop ShiftEvent) 2025年12月18日 23:06:34 +01:00
edwardloveall force-pushed el-drop-shift-event from e20e448a11
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
to f83e205fc3
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
2025年12月29日 17:39:00 +01:00
Compare
Author
Owner
Copy link

I'm going to merge this because I'd like to have it in before adding a feature that deals with model names. I re-reviewed it myself and while it's a somewhat risky change, the tests all passing gives me a lot more confidence and I think it will make things easier to debug in the future.

I'm going to merge this because I'd like to have it in before adding a feature that deals with model names. I re-reviewed it myself and while it's a somewhat risky change, the tests all passing gives me a lot more confidence and I think it will make things easier to debug in the future.
edwardloveall deleted branch el-drop-shift-event 2025年12月29日 17:59:15 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!65
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-drop-shift-event"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?