2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-11-16 12:14:22 +00:00
|
|
|
|
|
|
|
class Issue3851 < ActiveRecord::Migration[6.0]
|
|
|
|
def change
|
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
|
|
|
|
|
|
|
fix_follow_up_assignment
|
|
|
|
fix_follow_up_possible
|
|
|
|
end
|
|
|
|
|
|
|
|
def fix_follow_up_assignment
|
|
|
|
follow_up_assignment = ObjectManager::Attribute.for_object('Group').find_by(name: 'follow_up_assignment')
|
|
|
|
follow_up_assignment.data_option['default'] = 'true'
|
|
|
|
follow_up_assignment.screens['create']['-all-']['null'] = false
|
|
|
|
follow_up_assignment.screens['edit']['-all-']['null'] = false
|
|
|
|
follow_up_assignment.save!
|
|
|
|
end
|
|
|
|
|
|
|
|
def fix_follow_up_possible
|
|
|
|
follow_up_possible = ObjectManager::Attribute.for_object('Group').find_by(name: 'follow_up_possible')
|
|
|
|
follow_up_possible.screens['create']['-all-']['null'] = false
|
|
|
|
follow_up_possible.screens['edit']['-all-']['null'] = false
|
|
|
|
follow_up_possible.save!
|
|
|
|
end
|
|
|
|
end
|