I am using audited
to track changes for a model called Page
. I would like to be able to find all audits associated with a certain user (via user_id
in the audits table).
How can I do that? So far, the only way I have found to access the Audit
model is like this:
@audits = Audited::Adapters::ActiveRecord::Audit.all
Which just doesn't seem like it's the right way to do things.
Trying @audits = Audit.all
gives an Uninitialized constant
error.
Is there a more graceful way of interacting with models provided by gems?
Maybe something like
include Audited::Adapters::ActiveRecord::Audit
and then you can do
@audits = Audit.all
?
I think that should work... Or better yet:
include Audited
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With