Skip to content

Commit

Permalink
unique list of route pattern ids gathered from relevant trips (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfauble authored Oct 25, 2023
1 parent 8d6ea1c commit 0da5bcb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ defmodule ApiWeb.RoutePatternController do
filters
|> Trip.filter_by()
|> Enum.map(& &1.route_pattern_id)
|> Enum.uniq()

Map.put(acc, :ids, route_pattern_ids)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,20 @@ defmodule ApiWeb.RoutePatternControllerTest do
route_pattern_id: route_pattern5.id
}

trip6 = %Model.Trip{
id: "trip6",
route_id: route1.id,
service_id: service.id,
route_pattern_id: route_pattern1.id
}

trip7 = %Model.Trip{
id: "trip7",
route_id: route1.id,
service_id: service.id,
route_pattern_id: route_pattern1.id
}

State.Service.new_state([service, future_service])
State.Route.new_state([route1, route2, route3])

Expand All @@ -615,7 +629,7 @@ defmodule ApiWeb.RoutePatternControllerTest do
route_pattern5
])

State.Trip.new_state([trip1, trip2, trip3, trip4, trip5])
State.Trip.new_state([trip1, trip2, trip3, trip4, trip5, trip6, trip7])
State.Trip.reset_gather()
State.RoutesByService.update!()

Expand Down

0 comments on commit 0da5bcb

Please sign in to comment.