2021-07-01 08:58:09 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
|
|
|
class Issue3617UserImageSourceFix < ActiveRecord::Migration[5.2]
|
|
|
|
def change
|
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
|
|
|
|
2021-07-15 12:31:46 +00:00
|
|
|
User.where("image_source NOT LIKE 'http%'").find_each do |user|
|
2021-07-01 08:58:09 +00:00
|
|
|
user.remove_invalid_image_source
|
|
|
|
user.save!
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|