5
11
Fork
You've already forked tomato
1

Remove more shift event references #98

Merged
edwardloveall merged 3 commits from el-shift-event-cleanup into main 2026年02月19日 15:15:54 +01:00

See commits for details

See commits for details
A bunch of methods still expected the type of eventable (ShiftEvent) as an argument. But ShiftEvent is unused so we can remove this argument.
Since we don't have two separate models, the separation of their attributes is
not used and adds unneeded complexity. The EventsService and related classes now
act on a single hash of attributes.
Merge params in ShiftEventOccurrencesController
All checks were successful
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Successful
1a08f89ec6
Now that all the EventsService objects take a single hash of params, we can
merge them in the view and controller.
I'd love to have better flow for adding tasks and users. The way it works now is
we set `task_ids` (or `user_ids`) in an array with the field_name
`event[task_ids][]`. If the `commit` param is `ADD TASK`, it adds a select tag
with that name, adding another value to the form params.
I also tried to use the `accepts_nested_attributes_for` pattern with
`fields_for(:tasks)`. The problem I ran into there was that rails expects that
the tasks _already_ belong to the event. When you're adding them before creation
or updating, rails throws a get an `ActiveRecord::NotFound` error. Setting an
array of `task_ids` seems to be the best option I can find for now.
thetizzo left a comment
Copy link

This cleans up a lot of interfaces! Awesome work

This cleans up a lot of interfaces! Awesome work
edwardloveall changed target branch from el-no-material-layout to main 2026年02月19日 15:15:31 +01:00
edwardloveall deleted branch el-shift-event-cleanup 2026年02月19日 15:16:18 +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
2 participants
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!98
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-shift-event-cleanup"

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?