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:
Peter Harkins 2011-11-06 17:12:03 -06:00
parent 7a11792786
commit 388fd152d5
1 changed files with 4 additions and 4 deletions

View File

@ -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.