-
Notifications
You must be signed in to change notification settings - Fork 679
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
Allow custom Audit classes #319
Allow custom Audit classes #319
Conversation
One potential problem with this implementation is that it makes use of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that .audit_class
is a good fit and don't have a problem with this functionality, and it looks like @danielmorrison is also in favour of the general direction from #314 (comment).
Could you rebase the PR please?
spec/audited/audit_spec.rb
Outdated
expect(audit).to be_a CustomAudit | ||
expect(audit.custom_method).to eq "I'm custom!" | ||
|
||
Audited.config { |config| config.audit_class = nil } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These cleanup sections should be in an after
block, rather than the main spec body. (If possible, also move the new classes and setup to a before
too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domcleal I've moved this into an around
block so that the audit class can be reset to its original value. Let me know if you'd prefer the before
/after
split and having config.audit_class
reset nil
as it is here.
Classes that inherit from `Audited::Audit` can be used instead of the default by assigning `Audited.audit_class` in an initializer. Resolves collectiveidea#314
8a55a28
to
2900181
Compare
👍 Rebased. I made an additional change to |
Thanks for the update @nickrivadeneira, merged! |
Hi , I am using audited in building an application , I am facing the issue with this gem which says - " It would be very helpful Thank you !! |
Classes that inherit from
Audited::Audit
can be used instead of thedefault by assigning
Audited.audit_class
in an initializer.Resolves #314