2016-11-25 16:10:37 +00:00
|
|
|
module Import
|
|
|
|
module OTRS
|
|
|
|
module StateFactory
|
|
|
|
extend Import::TransactionFactory
|
|
|
|
|
|
|
|
# rubocop:disable Style/ModuleFunction
|
|
|
|
extend self
|
|
|
|
|
2016-12-20 15:16:09 +00:00
|
|
|
def pre_import_hook(_records, *_args)
|
2016-11-25 16:10:37 +00:00
|
|
|
backup
|
|
|
|
end
|
|
|
|
|
|
|
|
def backup
|
|
|
|
# rename states to handle not uniq issues
|
|
|
|
::Ticket::State.all.each { |state|
|
|
|
|
state.name = state.name + '_tmp'
|
|
|
|
state.save
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|