From d64e8a291bb2c7bb373bdfea8a5d963b9e9785a5 Mon Sep 17 00:00:00 2001 From: Peng DU Date: Fri, 24 Jun 2016 18:36:36 +0200 Subject: [PATCH] remove order for avoid N+1 --- app/views/api/trainings/show.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/api/trainings/show.json.jbuilder b/app/views/api/trainings/show.json.jbuilder index 6afadde51..fbc0587b2 100644 --- a/app/views/api/trainings/show.json.jbuilder +++ b/app/views/api/trainings/show.json.jbuilder @@ -1,5 +1,5 @@ json.extract! @training, :id, :name, :machine_ids, :nb_total_places -json.availabilities @training.availabilities.order('start_at DESC') do |a| +json.availabilities @training.availabilities do |a| json.id a.id json.start_at a.start_at.iso8601 json.end_at a.end_at.iso8601