has_online_notifications.rb 462 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module HasOnlineNotifications
  3. extend ActiveSupport::Concern
  4. included do
  5. before_destroy :online_notification_destroy
  6. end
  7. =begin
  8. delete object online notification list, will be executed automatically
  9. model = Model.find(123)
  10. model.online_notification_destroy
  11. =end
  12. def online_notification_destroy
  13. OnlineNotification.remove(self.class.to_s, id)
  14. true
  15. end
  16. end