Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix warning when exporting Staff Actions (#22168)

Juan David Martínez Cubillos0626b7c413a1
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