map_id.rb 443 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Kayako::MapId < Sequencer::Unit::Base
  3. prepend ::Sequencer::Unit::Import::Common::Model::Mixin::Skip::Action
  4. optional :action
  5. skip_action :skipped, :failed
  6. uses :id_map, :model_class, :resource, :instance
  7. def process
  8. id_map[model_class.name] ||= {}
  9. id_map[model_class.name][resource['id']] = instance.id
  10. end
  11. end