has_activity_stream_log.rb 469 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module DataPrivacyTask::HasActivityStreamLog
  3. extend ActiveSupport::Concern
  4. included do
  5. include ::HasActivityStreamLog
  6. after_update :log_activity
  7. activity_stream_permission 'admin.data_privacy'
  8. end
  9. def log_activity
  10. return if !saved_change_to_attribute?('state')
  11. return if state != 'completed'
  12. activity_stream_log('completed', created_by_id, true)
  13. end
  14. end