mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
This commit is contained in:
parent
291aad0e15
commit
4b29959e6e
1 changed files with 23 additions and 25 deletions
48
README.md
48
README.md
|
@ -29,9 +29,30 @@ There's an excellent [Railscast on implementing Undo with Paper Trail](http://ra
|
||||||
* Threadsafe.
|
* Threadsafe.
|
||||||
|
|
||||||
|
|
||||||
## Rails Version
|
## Compatibility
|
||||||
|
|
||||||
Works on Rails 3 and Rails 2.3. The Rails 3 code is on the `master` branch and tagged `v2.x`. The Rails 2.3 code is on the `rails2` branch and tagged `v1.x`. Please note I'm not adding new features to the Rails 2.3 codebase.
|
Works with ActiveRecord 4 and ActiveRecord 3. Note: this code is on the `master` branch and tagged `v3.x`.
|
||||||
|
|
||||||
|
Version 2 is on the branch named [`2.7-stable`](https://github.com/airblade/paper_trail/tree/2.7-stable) and is tagged `v2.x`, and works with Rails 3.
|
||||||
|
The Rails 2.3 code is on the [`rails2`](https://github.com/airblade/paper_trail/tree/2.7-stable) branch and tagged `v1.x`. These branches are both stable with their respective versions of Rails but will not have new features added/backported to them.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Rails 3 & 4
|
||||||
|
|
||||||
|
1. Install PaperTrail as a gem via your `Gemfile`:
|
||||||
|
|
||||||
|
`gem 'paper_trail', '~> 3.0'`
|
||||||
|
|
||||||
|
2. Generate a migration which will add a `versions` table to your database.
|
||||||
|
|
||||||
|
`bundle exec rails generate paper_trail:install`
|
||||||
|
|
||||||
|
3. Run the migration.
|
||||||
|
|
||||||
|
`bundle exec rake db:migrate`
|
||||||
|
|
||||||
|
4. Add `has_paper_trail` to the models you want to track.
|
||||||
|
|
||||||
|
|
||||||
## API Summary
|
## API Summary
|
||||||
|
@ -798,29 +819,6 @@ sql> delete from versions where created_at < 2010-06-01;
|
||||||
>> PaperTrail::Version.delete_all ["created_at < ?", 1.week.ago]
|
>> PaperTrail::Version.delete_all ["created_at < ?", 1.week.ago]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### Rails 3
|
|
||||||
|
|
||||||
1. Install PaperTrail as a gem via your `Gemfile`:
|
|
||||||
|
|
||||||
`gem 'paper_trail', '~> 2'`
|
|
||||||
|
|
||||||
2. Generate a migration which will add a `versions` table to your database.
|
|
||||||
|
|
||||||
`bundle exec rails generate paper_trail:install`
|
|
||||||
|
|
||||||
3. Run the migration.
|
|
||||||
|
|
||||||
`bundle exec rake db:migrate`
|
|
||||||
|
|
||||||
4. Add `has_paper_trail` to the models you want to track.
|
|
||||||
|
|
||||||
### Rails 2
|
|
||||||
|
|
||||||
Please see the `rails2` branch.
|
|
||||||
|
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
PaperTrail uses Bundler to manage its dependencies (in development and testing). You can run the tests with `bundle exec rake test`. (You may need to `bundle install` first.)
|
PaperTrail uses Bundler to manage its dependencies (in development and testing). You can run the tests with `bundle exec rake test`. (You may need to `bundle install` first.)
|
||||||
|
|
Loading…
Reference in a new issue