From 9df0d9810957241d72de7f01d88ec049c086225e Mon Sep 17 00:00:00 2001 From: maatinito <15379878+maatinito@users.noreply.github.com> Date: Fri, 3 Dec 2021 07:22:47 -1000 Subject: [PATCH] Fix csv download of stats https://medium.com/@mitsun.chieh/activerecord-relation-with-raw-sql-argument-returns-a-warning-exception-raising-8999f1b9898a --- app/controllers/stats_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 67531416b..eec5c5b2f 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -57,9 +57,9 @@ class StatsController < ApplicationController "procedures.libelle", "users.id", "dossiers.state", - "dossiers.depose_at - dossiers.created_at", - "dossiers.en_instruction_at - dossiers.depose_at", - "dossiers.processed_at - dossiers.en_instruction_at" + Arel.sql("dossiers.depose_at - dossiers.created_at"), + Arel.sql("dossiers.en_instruction_at - dossiers.depose_at"), + Arel.sql("dossiers.processed_at - dossiers.en_instruction_at") ) end