htmldiff: expects but doesn't require HTML input and produces HTML. ![]() To diff non-adjacent versions you'll have to write your own code. This means you canĭelete any version without affecting any other. Object's data, not a diff from the previous version. Make each version of an object self-contained. When I designed PaperTrail I wanted simplicity and robustness so I decided to As of 10.0.0, they are stored for all three events. Prior to 10.0.0, the object_changes were only stored for create and updateĮvents. # Returns the item restored from this version. Instance, with all the usual methods) has methods such as: next_versionĪnd a PaperTrail::Version instance (which is just an ordinary ActiveRecord ![]() previous_version # Returns the widget (not a version) as it became next. version_at ( timestamp ) # Returns the widget (not a version) as it was most recently. originator # Returns the widget (not a version) as it looked at the given timestamp. live? # Returns who put the widget into its current state. version # Returns true if this widget is the current, live one or false if it is from # a previous version. # You can customise the name of the method. versions # Return the version this widget was reified from, or nil if it is live. You can customise the name of the # association, but overriding this method is not supported. ![]() InstallationĪdd PaperTrail to your Gemfile and run bundle.Ĭlass Widget < ActiveRecord:: Base has_paper_trail end # Returns this widget's versions. Compatibility paper_trailĮxperts: to install incompatible versions of activerecord, see Finding Out Who Was Responsible For A Change See how a model lookedĪt any stage in its lifecycle, revert it to any version, or restore it after it Track changes to your models, for auditing or versioning.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |