Doc fix: constant needs to be defined before use.
lib/has_paper_trail.rb line 58, since 69b7a149
, attempts to use this constant
immediately, so it needs to be defined before use. I don't see an easy way to
delay making that reference, so here's a tweak to so the example in the doc
works.
This commit is contained in:
parent
7a11792786
commit
388fd152d5
|
@ -327,15 +327,15 @@ To find out who made a `version`'s object look that way, use `version.originator
|
|||
|
||||
You can specify custom version subclasses with the `:class_name` option:
|
||||
|
||||
class Post < ActiveRecord::Base
|
||||
has_paper_trail :class_name => 'PostVersion'
|
||||
end
|
||||
|
||||
class PostVersion < Version
|
||||
# custom behaviour, e.g:
|
||||
set_table_name :post_versions
|
||||
end
|
||||
|
||||
class Post < ActiveRecord::Base
|
||||
has_paper_trail :class_name => 'PostVersion'
|
||||
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.
|
||||
|
||||
Alternatively you could store certain metadata for one type of version, and other metadata for other versions.
|
||||
|
|
Loading…
Reference in New Issue