Skip to content

Commit

Permalink
Added example for auditing grandchildren
Browse files Browse the repository at this point in the history
  • Loading branch information
jclark42796 committed Jul 5, 2012
1 parent 810d6c4 commit 542f6b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.rdoc
Expand Up @@ -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.
Expand Down

0 comments on commit 542f6b3

Please sign in to comment.