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

Ignore callbacks if not specifed on the model #679

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

JDrizzy
Copy link
Contributor

@JDrizzy JDrizzy commented Jul 18, 2023

Related comment/discussion: #662 (comment)

With the addition of touch auditing, I thought maybe a configuration could exclude certain callbacks unless the callback action was specified on the model.

Audited.ignored_default_callbacks = [:touch]

class User < ActiveRecord::Base
   audited
end
# audits on action :create, :update, :destroy

class Company < ActiveRecord::Base
  audited on: [:create, :touch]
end
# audits on action :create, :touch

README.md Outdated Show resolved Hide resolved
@danielmorrison danielmorrison merged commit 00a1d82 into collectiveidea:main Jan 11, 2024
69 checks passed
@JDrizzy JDrizzy deleted the ignore-callbacks branch January 11, 2024 21:35
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.

2 participants