Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for audit_attributes #732

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nazamoresco
Copy link

In the current project I'm working on, we introduced a new column to the audit class but struggled to find an elegant way to set it dynamically. A feature similar to audit_comment but more flexible would provide a more convenient solution.

This PR introduces the audit_attributes feature to the gem, offering a flexible approach to include additional custom attributes during the auditing process. The following changes have been made:

  • Added audit_attributes to track custom attributes during auditing.
  • Implemented validation to ensure audit_attributes is a hash containing only valid keys from the audit class.
  • Enhanced the audit creation, update, and destroy methods to include audit_attributes in audit records.
  • Updated specs to test the inclusion of audit_attributes in audit records and validate its correctness.
  • Modified the schema to include a new custom_attribute column in the audits table.
  • Ran the linter to ensure code quality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant