Organize information about Custom Version Classes
Separate "Advantages" from "Configuration" [ci skip]
This commit is contained in:
parent
7659688cf3
commit
3b386d1516
10
README.md
10
README.md
|
@ -563,7 +563,13 @@ class Post < ActiveRecord::Base
|
|||
end
|
||||
```
|
||||
|
||||
This allows you to store each model's versions in a separate table, which is useful if you have a lot of versions being created.
|
||||
### Advantages
|
||||
|
||||
1. For models which have a lot of versions, storing each model's versions in a
|
||||
separate table can improve the performance of certain database queries.
|
||||
1. Store different version [metadata](#storing-metadata) for different models.
|
||||
|
||||
### Configuration
|
||||
|
||||
If you are using Postgres, you should also define the sequence that your custom version class will use:
|
||||
|
||||
|
@ -574,8 +580,6 @@ class PostVersion < PaperTrail::Version
|
|||
end
|
||||
```
|
||||
|
||||
Alternatively you could store certain metadata for one type of version, and other metadata for other versions.
|
||||
|
||||
If you only use custom version classes and don't use PaperTrail's built-in one, on Rails `>= 3.2` you must:
|
||||
|
||||
- either declare the `PaperTrail::Version` class to be abstract like this (in an initializer):
|
||||
|
|
Loading…
Reference in New Issue