20210622144000_issue_3617_user_image_source_fix.rb 355 B

123456789101112
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3617UserImageSourceFix < ActiveRecord::Migration[5.2]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. User.where("image_source NOT LIKE 'http%'").find_each do |user|
  6. user.remove_invalid_image_source
  7. user.save!
  8. end
  9. end
  10. end