state_factory.rb 439 B

12345678910111213141516171819202122
  1. module Import
  2. module OTRS
  3. module StateFactory
  4. extend Import::TransactionFactory
  5. # rubocop:disable Style/ModuleFunction
  6. extend self
  7. def pre_import_hook(_records, *_args)
  8. backup
  9. end
  10. def backup
  11. # rename states to handle not uniq issues
  12. ::Ticket::State.all.each { |state|
  13. state.name = state.name + '_tmp'
  14. state.save
  15. }
  16. end
  17. end
  18. end
  19. end