Skip to content

Commit

Permalink
Merge pull request #121 from thomasklemm/master
Browse files Browse the repository at this point in the history
Readme: Add instructions on limiting fields
  • Loading branch information
bryckbost committed May 1, 2013
2 parents 2d6330a + bd51cd0 commit f862ef4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@ audit.action # => "update"
audit.audited_changes # => {"name"=>["Steve", "Ryan"]}
```

### Specifying columns

By default, a new audit is created for any attribute changes. You can, however, limit the columns to be considered.

```ruby
class User < ActiveRecord::Base
# All fields
# audited

# Single field
# audited only: :name

# Multiple fields
# audited only: [:name, :address]

# All except certain fields
# audited except: :password
end
```

### Comments

You can attach comments to each audit using an `audit_comment` attribute on your model.
Expand Down

0 comments on commit f862ef4

Please sign in to comment.