From ecc419e6461d231e5ae8a69f37784421c0a72990 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 22 Aug 2023 09:21:02 +0200 Subject: select latest journey based on timestamp, not ID This avoids manually added past journeys messing with the latest travel target --- lib/Travelynx/Model/Journeys.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index 532f9cd..1c975f4 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -704,7 +704,7 @@ sub get_latest { cancelled => 0 }, { - order_by => { -desc => 'journey_id' }, + order_by => { -desc => 'real_dep_ts' }, limit => 1 } )->expand->hash; -- cgit v1.2.3