You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As that section of the README insinuates, one way to do it is to create a migration that is identical to the one PaperTrail generates for your versions table, and then use that (number 3 in your suggested methods). Another easy way to do it would be to use Single Table Inheritance, and make your custom version class a sub-class of the PaperTrail::Version class. Simply add an extra field to your migration for the versions table like so:
t.string :type
And then subclass your custom version model under the PaperTrail::Version class like the README suggests, but don't use the self.table_name option on the model. Rails will then know to use the type column as the indicator for which type of version your using. (But this will result in all version types being stored in the versions table, which may not be desired). Those are the options that I would recommend.
Oh, there is also a 3rd way to make a custom version class, and that involves using the new PaperTrail::VersionConcern module. Please see the discussion on #289 for more details about usage of that module.
With README(v3.0.0rc), section "Custom Version Classes", I didn't find any text about how to generate the database table for Custom Version Classes.
then, what's rake commands to do it?
Thanks
The text was updated successfully, but these errors were encountered: