20211115135421_issue3851.rb 932 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3851 < ActiveRecord::Migration[6.0]
  3. def change
  4. return if !Setting.exists?(name: 'system_init_done')
  5. fix_follow_up_assignment
  6. fix_follow_up_possible
  7. end
  8. def fix_follow_up_assignment
  9. follow_up_assignment = ObjectManager::Attribute.for_object('Group').find_by(name: 'follow_up_assignment')
  10. follow_up_assignment.data_option['default'] = 'true'
  11. follow_up_assignment.screens['create']['-all-']['null'] = false
  12. follow_up_assignment.screens['edit']['-all-']['null'] = false
  13. follow_up_assignment.save!
  14. end
  15. def fix_follow_up_possible
  16. follow_up_possible = ObjectManager::Attribute.for_object('Group').find_by(name: 'follow_up_possible')
  17. follow_up_possible.screens['create']['-all-']['null'] = false
  18. follow_up_possible.screens['edit']['-all-']['null'] = false
  19. follow_up_possible.save!
  20. end
  21. end