20210510092410_issue_3550_set_pretty.rb 461 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3550SetPretty < ActiveRecord::Migration[5.2]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. Cti::Log.reorder(created_at: :desc).limit(300).find_each do |log|
  6. log.set_pretty
  7. log.save!
  8. rescue
  9. Rails.logger.error "Issue3550SetPretty: Failed to migrate id #{log.id} with from '#{log.from}' and to '#{log.to}'"
  10. end
  11. end
  12. end