downcase.rb 685 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer
  3. class Unit
  4. module Import
  5. module Common
  6. module User
  7. module Attributes
  8. class Downcase < Sequencer::Unit::Base
  9. prepend ::Sequencer::Unit::Import::Common::Model::Mixin::Skip::Action
  10. skip_action :skipped, :failed
  11. uses :mapped
  12. def process
  13. %i[login email].each do |attribute|
  14. next if mapped[attribute].blank?
  15. mapped[attribute].downcase!
  16. end
  17. end
  18. end
  19. end
  20. end
  21. end
  22. end
  23. end
  24. end