has_karma_activity_log.rb 456 B

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