last_created_at.rb 464 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SystemReport::Plugin::Entities::LastCreatedAt < SystemReport::Plugin
  3. DESCRIPTION = __('Last created at of database objects (e.g. when was the last trigger created)').freeze
  4. def fetch
  5. counts = {}
  6. Models.all.each_key do |model|
  7. next if model.column_names.exclude?('created_at')
  8. counts[model.to_s] = model.maximum(:created_at)
  9. end
  10. counts
  11. end
  12. end