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

Fix callbacks not being created when updating audit options #751

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

Conversation

chaadow
Copy link

@chaadow chaadow commented Dec 24, 2024

The main use case is that audited allows users to update the audited options by calling audited multiple times.

# This create two callbacks `after_update` and `after_destroy`
audited on: [:update, :destroy]

# Now if we call audited a second time
# this unfortunately won't create the `after_create` callback when updating the configuration
audited on: [:update, :destroy, :create]

This pull requests fixes the issue so that it creates callbacks only for added configuration, in the example above it's the create one.

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