enable.rb 388 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Service::Channel::Admin
  3. class Enable < Service::Base
  4. def initialize(area:, channel_id:)
  5. super()
  6. @area = area
  7. @channel_id = channel_id
  8. end
  9. def execute
  10. Channel
  11. .in_area(@area)
  12. .find(@channel_id)
  13. .update!(active: true)
  14. end
  15. end
  16. end