skip.rb 574 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Kayako::ObjectAttribute::Skip < Sequencer::Unit::Base
  3. uses :resource
  4. provides :action
  5. def process
  6. return if (!resource['is_system'] && skip_attribute_types.exclude?(resource['type'])) || allowed_system_attributes.include?(resource['key'])
  7. state.provide(:action, :skipped)
  8. end
  9. private
  10. def skip_attribute_types
  11. @skip_attribute_types ||= %w[FILE]
  12. end
  13. def allowed_system_attributes
  14. @allowed_system_attributes ||= %w[type]
  15. end
  16. end