map_id.rb 446 B

12345678910111213141516
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Freshdesk::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