feat: add auditlogs for account model (#7511)
This commit is contained in:
@@ -2,6 +2,7 @@ module Enterprise::Audit::Account
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
audited except: :updated_at, on: [:update]
|
||||
has_associated_audits
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,11 @@ class Enterprise::AuditLog < Audited::Audit
|
||||
|
||||
def log_additional_information
|
||||
# rubocop:disable Rails/SkipsModelValidations
|
||||
update_columns(username: user&.email)
|
||||
if auditable_type == 'Account' && auditable_id.present?
|
||||
update_columns(associated_type: auditable_type, associated_id: auditable_id, username: user&.email)
|
||||
else
|
||||
update_columns(username: user&.email)
|
||||
end
|
||||
# rubocop:enable Rails/SkipsModelValidations
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user