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

This commit is contained in:
Juan David Martínez Cubillos 2023-06-18 20:23:21 -05:00 committed by GitHub
parent e2e17bfb0f
commit 0626b7c413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -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