Module PaperTrail::Model::InstanceMethods
In: lib/paper_trail/has_paper_trail.rb

Wrap the following methods in a module so we can include them only in the ActiveRecord models that declare `has_paper_trail`.

Methods

External Aliases

new_record? -> old_new_record?
present? -> new_record?
old_new_record? -> new_record?

Public Instance methods

Utility method for reifying. Anything executed inside the block will appear like a new record.

Invoked after rollbacks to ensure versions records are not created for changes that never actually took place

Returns true if this instance is the current, live one; returns false if this instance came from a previous version.

Returns the object (not a Version) as it became next. NOTE: if self (the item) was not reified from a version, i.e. it is the

 "live" item, we return nil.  Perhaps we should return self instead?

Returns who put the object into its current state.

Returns the object (not a Version) as it was most recently.

Mimics the `touch` method from `ActiveRecord::Persistence`, but also creates a version. A version is created regardless of options such as `:on`, `:if`, or `:unless`.

TODO: look into leveraging the `after_touch` callback from `ActiveRecord` to allow the regular `touch` method to generate a version as normal. May make sense to switch the `record_update` method to leverage an `after_update` callback anyways (likely for v4.0.0)

Returns the object (not a Version) as it was at the given timestamp.

Returns the objects (not Versions) as they were between the given times.

Temporarily overwrites the value of whodunnit and then executes the provided block.

Executes the given method or block without creating a new version.

[Validate]