multiple.rb 405 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class FormUpdater::StoreValue::Multiple < FormUpdater::StoreValue::Base
  3. def can_handle_field?(field:, value:)
  4. multiple_fields.include? field
  5. end
  6. def map_value(field:, value:)
  7. return '' if !value.is_a?(Array)
  8. value.join(', ')
  9. end
  10. def multiple_fields
  11. %w[
  12. to
  13. cc
  14. tags
  15. ]
  16. end
  17. end