-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup(ex/db/detour): remove state_value
#2965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if possible can we try to remove any calls to categorize_detour
that aren't happening before an update/create in the DB?
https://github.com/mbta/skate/blob/main/lib/skate/detours/detours.ex#L242
https://github.com/mbta/skate/blob/main/lib/skate/detours/detours.ex#L362
These should be able to just reference the status
field instead of needing to calculate from the state.
Then I think we can move the logic of this function to the add_status
function used within the Detour.changeset
here: https://github.com/mbta/skate/blob/main/lib/skate/detours/db/detour.ex#L65 since any status updates I believe should be persisted and subsequently updated in the status
field and available for use wherever needed either in a return response or side effect branching and would limit the surface area for state/prop consistency issue that could arise
b50bc19
to
fc2ec51
Compare
Sure yeah! I'd prefer to have that in it's own PR, as this should only be concerned with the See #2967 |
…ted before deactivating
…_by_id` ================================================================================
fc2ec51
to
ef2c6bf
Compare
PR for
:state_value
removal thread #2961 (comment)