triggers_subscriptions.rb 487 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. # Trigger GraphQL subscriptions on template changes.
  3. module Template::TriggersSubscriptions
  4. extend ActiveSupport::Concern
  5. included do
  6. after_commit :trigger_subscriptions
  7. end
  8. private
  9. def trigger_subscriptions
  10. Gql::Subscriptions::TemplateUpdates.trigger(nil, arguments: { only_active: false })
  11. Gql::Subscriptions::TemplateUpdates.trigger(nil, arguments: { only_active: true })
  12. end
  13. end