20230310122944_core_workflow_secondary_organization.rb 844 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class CoreWorkflowSecondaryOrganization < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. CoreWorkflow.create_if_not_exists(
  7. name: 'base - show secondary organization based on user',
  8. object: 'Ticket',
  9. condition_saved: {
  10. 'custom.module': {
  11. operator: 'match all modules',
  12. value: [
  13. 'CoreWorkflow::Custom::SecondaryOrganization',
  14. ],
  15. },
  16. },
  17. perform: {
  18. 'custom.module': {
  19. execute: ['CoreWorkflow::Custom::SecondaryOrganization']
  20. },
  21. },
  22. changeable: false,
  23. created_by_id: 1,
  24. updated_by_id: 1,
  25. )
  26. end
  27. end