select.rb 695 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. class Zendesk
  4. module ObjectAttribute
  5. class Select < Import::Zendesk::ObjectAttribute::Base
  6. def init_callback(object_attribte)
  7. @data_option.merge!(
  8. default: '',
  9. options: options(object_attribte),
  10. )
  11. end
  12. private
  13. def data_type(_attribute)
  14. 'select'
  15. end
  16. def options(object_attribte)
  17. result = {}
  18. object_attribte.custom_field_options.each do |entry|
  19. result[ entry['value'] ] = entry['name']
  20. end
  21. result
  22. end
  23. end
  24. end
  25. end
  26. end