From 0626b7c413a17d569aa1f10d079d066448f3b84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20David=20Mart=C3=ADnez=20Cubillos?= Date: Sun, 18 Jun 2023 20:23:21 -0500 Subject: [PATCH] DEV: Fix warning when exporting Staff Actions (#22168) --- app/jobs/regular/export_csv_file.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rb index ccdb60ef9d4..114c07b377a 100644 --- a/app/jobs/regular/export_csv_file.rb +++ b/app/jobs/regular/export_csv_file.rb @@ -171,12 +171,14 @@ module Jobs staff_action_data = if @current_user.admin? - UserHistory.only_staff_actions.order("id DESC") + UserHistory.only_staff_actions else - UserHistory.where(admin_only: false).only_staff_actions.order("id DESC") + UserHistory.where(admin_only: false).only_staff_actions end - staff_action_data.find_each { |staff_action| yield get_staff_action_fields(staff_action) } + staff_action_data.find_each(order: :desc) do |staff_action| + yield get_staff_action_fields(staff_action) + end end def screened_email_export