Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added example for auditing grandchildren

  • Loading branch information...
commit 542f6b32edb772740297b55d5e7bf05191b1e99c 1 parent 810d6c4
@jclark42796 jclark42796 authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 README.rdoc
View
4 README.rdoc
@@ -74,6 +74,10 @@ The audited_changes column automatically serializes the changes of any model att
# Associate the audit records with a related model, which becomes the owner
audit(:update, :on => :book)
+ # Associate the audit records with a related model, multiple levels up.
+ # Here, we're auditing a great-grandchild where :parent will be the owner. Order is important.
+ audit(:update, :on => [:grandchild, :child, :parent])
+
= Make Auditing Important
There's an alternate form of specifying your audit requirements that will cause the create, find, update, or destroy to fail if for some reason the audit record cannot be saved to the database. Instead of calling audit, call audit! instead.
Please sign in to comment.
Something went wrong with that request. Please try again.