Skip to content

Commit

Permalink
Detailed Routes APIs return trips' past stops
Browse files Browse the repository at this point in the history
  • Loading branch information
blahblahblah- committed Apr 14, 2024
1 parent 7db5ea0 commit c2535ac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/route_analyzer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -929,9 +929,8 @@ def self.format_trips_with_upcoming_stop_times(processed_trips, travel_times)
}.uniq { |routing_id, trip|
trip.id
}.map { |routing_id, trip|
stops = {}
stops = trip.past_stops.dup
last_past_stop = trip.past_stops.keys.last
stops[last_past_stop] = trip.past_stops[last_past_stop] if last_past_stop
stops[trip.upcoming_stop] = trip.estimated_upcoming_stop_arrival_time
trip.upcoming_stops.each_cons(2).reduce(trip.estimated_upcoming_stop_arrival_time) { |sum, (a_stop, b_stop)|
pair_str = "#{a_stop}-#{b_stop}"
Expand Down

0 comments on commit c2535ac

Please sign in to comment.