2017-05-05 09:16:47 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
module HasOnlineNotifications
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
before_destroy :online_notification_destroy
|
|
|
|
end
|
|
|
|
|
|
|
|
=begin
|
|
|
|
|
|
|
|
delete object online notification list, will be executed automatically
|
|
|
|
|
|
|
|
model = Model.find(123)
|
|
|
|
model.online_notification_destroy
|
|
|
|
|
|
|
|
=end
|
|
|
|
|
|
|
|
def online_notification_destroy
|
|
|
|
OnlineNotification.remove(self.class.to_s, id)
|
2017-06-16 22:53:20 +00:00
|
|
|
true
|
2017-05-05 09:16:47 +00:00
|
|
|
end
|
|
|
|
end
|