From c7c23378f8771d69f62b8a7e84d1a22f334cf6dc Mon Sep 17 00:00:00 2001 From: Mark Oveson Date: Sun, 18 Feb 2018 22:31:21 -0700 Subject: [PATCH] Sort pulled live_times by absolute time as primary key. --- app/controllers/api/v1/event_groups_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/event_groups_controller.rb b/app/controllers/api/v1/event_groups_controller.rb index b7c1b336f..9b5ae0b57 100644 --- a/app/controllers/api/v1/event_groups_controller.rb +++ b/app/controllers/api/v1/event_groups_controller.rb @@ -20,7 +20,7 @@ def pull_live_time_rows live_times_limit = (params[:page] && params[:page][:size]) || live_times_default_limit scoped_live_times = force_pull ? @resource.live_times.unmatched : @resource.live_times.unconsidered - selected_live_times = scoped_live_times.order(:event_id, :split_id, :bib_number, :bitkey).limit(live_times_limit) + selected_live_times = scoped_live_times.order(:absolute_time, :event_id, :bib_number, :split_id, :bitkey).limit(live_times_limit) grouped_live_times = selected_live_times.group_by(&:event_id)