trabajo-afectivo/db/migrate/20210622144000_issue_3617_user_image_source_fix.rb
2022-01-01 14:38:12 +01:00

12 lines
355 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Issue3617UserImageSourceFix < ActiveRecord::Migration[5.2]
def change
return if !Setting.exists?(name: 'system_init_done')
User.where("image_source NOT LIKE 'http%'").find_each do |user|
user.remove_invalid_image_source
user.save!
end
end
end