trabajo-afectivo/app/models/data_privacy_task/has_activity_stream_log.rb
2022-01-01 14:38:12 +01:00

19 lines
469 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module DataPrivacyTask::HasActivityStreamLog
extend ActiveSupport::Concern
included do
include ::HasActivityStreamLog
after_update :log_activity
activity_stream_permission 'admin.data_privacy'
end
def log_activity
return if !saved_change_to_attribute?('state')
return if state != 'completed'
activity_stream_log('completed', created_by_id, true)
end
end