Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

Commit

Permalink
Add exclusions for actions and fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Harton committed Dec 14, 2009
1 parent f36d13b commit 317b3cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README
Expand Up @@ -76,6 +76,8 @@ available are:
- an array containing symbols describing on which actions to write
audit logs. Defaults to
[ :accessed, :modified, :saved, :created, :deleted ].
- opposite :except => []
speficially exclude an action from auditing.
:identity =>
- Auditable also adds an around_filter to your ApplicationController
to make sure that it has access to the currently logged in user
Expand All @@ -88,6 +90,8 @@ available are:
Defaults to [ :all ] (:all is a special name meaning all fields).
Note that you can never audit :id because it will cause an infinite
loop.
- opposite :not => []
specifically exclude a field from auditing.
:log_field =>
- A symbol naming the text field in the auditor model to store the
log information in. Only useful if you need something more than the
Expand Down
3 changes: 2 additions & 1 deletion lib/acts_as_auditable.rb
Expand Up @@ -37,6 +37,7 @@ def acts_as_auditable(options={})
:except => [],
:identity => :current_user,
:for => [ :all ],
:not => [],
:log_field => :log,
:identity_field => :identity,
}
Expand Down Expand Up @@ -142,7 +143,7 @@ def #{m}
if options[:for].member? :all
columns = self.column_names()
else
columns = options[:for].collect do |column|
columns = (options[:for]-options[:not]).collect do |column|
column.to_s
end
end
Expand Down

0 comments on commit 317b3cf

Please sign in to comment.