From 0dc9f7798e211c2cdca2895cff29f392d9486ea3 Mon Sep 17 00:00:00 2001 From: Stephen Yeargin Date: Sat, 16 Mar 2024 12:34:34 -0500 Subject: [PATCH] Fix if service ID not found --- lib/tasks/import.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 24a380b..abb4e39 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -81,7 +81,7 @@ namespace :import do @source.each_calendar_date do |row| date = CalendarDate.new(CalendarDate.hash_from_gtfs(row)) if date.calendar_id.nil? - puts "[ERROR] Calendar ID is nil for #{date.service_id} / #{date.date}" + puts "[ERROR] Calendar ID is nil for #{date.inspect}" next end @@ -287,7 +287,7 @@ namespace :import do trip.start_time = stop_times.first.departure_time trip.end_time = stop_times.last.arrival_time - trip.save! + trip.save! if trip.valid? end end