group.rb 433 B

123456789101112131415161718192021
  1. module Import
  2. module Zendesk
  3. class Group
  4. include Import::Helper
  5. attr_reader :zendesk_id, :id
  6. def initialize(group)
  7. local_group = ::Group.create_if_not_exists(
  8. name: group.name,
  9. active: !group.deleted,
  10. updated_by_id: 1,
  11. created_by_id: 1
  12. )
  13. @zendesk_id = group.id
  14. @id = local_group.id
  15. end
  16. end
  17. end
  18. end