lib/gtfs/realtime/stop_time_update.rb in gtfs-realtime-0.3.0 vs lib/gtfs/realtime/stop_time_update.rb in gtfs-realtime-0.4.0
- old
+ new
@@ -1,10 +1,18 @@
module GTFS
class Realtime
class StopTimeUpdate < GTFS::Realtime::Model
- one_through_one :route, join_table: :gtfs_realtime_trip_updates, left_key: :id, left_primary_key: :trip_update_id, right_key: :route_id
- many_to_one :stop
- one_through_one :trip, join_table: :gtfs_realtime_trip_updates, left_key: :id, left_primary_key: :trip_update_id, right_key: :trip_id
- many_to_one :trip_update
+ belongs_to :stop
+ belongs_to :trip_update
+ has_one :trip, through: :trip_update
+ has_one :route, through: :trip_update
+
+ def arrival_time
+ super ? super.in_time_zone(Time.zone) : nil
+ end
+
+ def departure_time
+ super ? super.in_time_zone(Time.zone) : nil
+ end
end
end
end