From 6bf8291c565c5b54caa6b5478a37bca483a5e64b Mon Sep 17 00:00:00 2001 From: Drew Dara-Abrams Date: Thu, 17 Feb 2022 22:18:12 -0800 Subject: [PATCH] get `gtfs_agency_id` from v2 when available --- app/serializers/operator_in_feed_serializer.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/serializers/operator_in_feed_serializer.rb b/app/serializers/operator_in_feed_serializer.rb index 531847a7..cba6f8e0 100644 --- a/app/serializers/operator_in_feed_serializer.rb +++ b/app/serializers/operator_in_feed_serializer.rb @@ -24,6 +24,11 @@ class OperatorInFeedSerializer < ApplicationSerializer :feed_onestop_id, :operator_url, :feed_url + + def gtfs_agency_id + object.gtfs_agency_id || object.try(:resolved_gtfs_agency_id) + end + def operator_onestop_id object.operator.try(:onestop_id) || object.try(:resolved_onestop_id)