-
Notifications
You must be signed in to change notification settings - Fork 2
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
Revert "Revert "Determine emptier car location and crowding description"" #685
Revert "Revert "Determine emptier car location and crowding description"" #685
Conversation
Coverage of commit
|
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.
See comment, then looks good.
lib/engine/locations.ex
Outdated
) | ||
(location["vehicle"]["multi_carriage_details"] && | ||
Enum.map( | ||
location["vehicle"]["multi_carriage_details"], |
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.
nit: If we do location["vehicle"]["multi_carriage_details"] || []
, we could remove the outer guard and map over it unconditionally, which might be a little cleaner.
Coverage of commit
|
Coverage of commit
|
Reverts #684
Errors were occurring in Dev because the
multi_carriage_details
field is still only in dev-green and that was causingget_crowding_description
to attempt to callEnum.map(nil)
.Adding a default of
[]
to the parsing logic. Tested against the prod RTR feed to make sure there are no errors.