Compare Versions - paper_trail
RubyGems / paper_trail / Compare Versions
17.0.0 (2025-10-24)
Breaking Changes
- None
Added
rails generate paper_trail:installnow accepts an argument for custom versions table, e.g.rails generate paper_trail:install CommentVersioncreatedcomment_versionstablerails generate paper_trail:update_item_subtypenow supports custom version classes via--version-class-nameoption, e.g.--version-class-name=CommentVersion
Fixed
- None
Dependencies
- Drop support for Rails 6.1, which [reached EoL on 2024-10-01][2]
- Drop support for Rails 7.0, which [reached EoL on 2025-04-01][2]
- Add support for Rails 8.1
- Drop support for Ruby 3.0, which [reached EoL on 2024-04-23][3]
- Drop support for Ruby 3.1, which [reached EoL on 2024-03-31][3]
16.0.0 (2024-11-08)
Breaking Changes
- #1478 Do not allow
multiple
has_paper_traildefinitions for models. Previously, whenhas_paper_trailwas called on a parent and a child from STI, then possibly multipleversionrecords will be created per event (create,destroyetc).
Added
- #1498 - Rails 8.0
- #1422 - Add
version_error_behaviorconfig config option to control error handling when creating/updating/deletingVersionrecords.
Fixed
- None
15.1.0 (2023-10-22)
Breaking Changes
- None
Fixed
- None
Dependencies
- Add support for Rails 7.1
- Add support for Ruby 3.2
15.0.0 (2023-08-06)
Breaking Changes
- None
Added
- #1416 - Adds a
model-configurable option
synchronize_version_creation_timestampwhich, if set to false, opts out of synchronizing timestamps betweenVersion.created_atand the record'supdated_at.
Fixed
- #1422 - Fix the issue that unencrypted plaintext values are versioned with ActiveRecord encryption (since Rails 7) when using JSON serialization on PostgreSQL json columns.
- #1414 - When
generating the migration, the version table will use uuid as primary key type
if
--uuidflag is specified.
Dependencies
- Drop support for Rails 6.0, which [reached EoL on 2023-06-01][2]
- Drop support for Ruby 2.7, which [reached EoL on 2023-03-31][3]
14.0.0 (2022-11-26)
Breaking Changes
- #1399 - Same
change re:
YAML.safe_loadas in 13.0.0, but this time for Rails 6.0 and 6.1.- This change only affects users whose
versionstable hasobjectorobject_changescolumns of typetext, and who use the YAML serializer. People who use the JSON serializer, or those withjson(b)columns, are unaffected. - Please see doc/pt_13_yaml_safe_load.md for details.
- This change only affects users whose
- #1406 -
Certain [Metadata][1] keys are now forbidden, like
id, anditem_type. These keys are reserved by PT.- This change is unlikely to affect anyone. It is not expected that anyone uses these metadata keys. Most people probably don't use PT metadata at all.
Dependencies
- Drop support for Rails 5.2, which reached EoL on 2022-06-01
- Drop support for Ruby 2.6, which reached EoL on 2022-03-31
- Drop support for request_store < 1.4
Added
- None
Fixed
- #1395 -
Fix incorrect
Version#created_atvalue when usingPaperTrail::RecordTrail#update_columns - #1404 - Delay referencing ActiveRecord until after Railtie is loaded
- Where possible, methods which are not part of PaperTrail's public API have
had their access changed to private. All of these methods had been clearly
marked as
@api privatein the documentation, for years. This is not expected to be a breaking change.
13.0.0 (2022-08-15)
Breaking Changes
- For Rails >= 7.0, the default serializer will now use
YAML.safe_loadunlessActiveRecord.use_yaml_unsafe_load. This change only affects users whoseversionstable hasobjectorobject_changescolumns of typetext, and who use the YAML serializer. People who use the JSON serializer, or those withjson(b)columns, are unaffected. Please see doc/pt_13_yaml_safe_load.md for details.
Added
- None
Fixed
- None
12.3.0 (2022-03-13)
Breaking Changes
- None
Added
- #1371 - Added
in_after_callbackargument toPaperTrail::RecordTrail#save_with_version, to allow the caller to indicate if this method is being called during anaftercallback. Defaults tofalse. - #1374 - Added
option
--uuidwhen generating new migration. This can be used to set the type of item_id column to uuid for use with paper_trail on a database that uses uuid as primary key.
Fixed
12.1.0 (2021-08-30)
Breaking Changes
- None
Added
- #1292 -
where_attribute_changesqueries for versions where the object's attribute changed to or from any values. - #1291 -
where_object_changes_toqueries for versions where the object's attributes changed to one set of known values from any other set of values.
Fixed
- #1285 -
For ActiveRecord >= 6.0, the
touchcallback will no longer create a newVersionfor skipped or ignored attributes. - #1309 -
Removes
item_subtyperequirement when specifying model-specific limits. - #1333 -
Improve reification of STI models that use
find_sti_class/sti_class_forto customize single table inheritance.
12.0.0 (2021-03-29)
Breaking Changes
- #1281 Rails:
Instead of an
Engine, PT now provides aRailtie, which is simpler. This was not expected to be a breaking change, but has caused trouble for some people:- Issue with the deprecated
autoloader = :classicsetting (https://github.com/paper-trail-gem/paper_trail/issues/1305)
- Issue with the deprecated
- Rails: The deprecated
config.paper_trailconfiguration technique has been removed. This configuration object was deprecated in 10.2.0. It only had one key,config.paper_trail.enabled. Please review docs section 2.d. Turning PaperTrail Off for alternatives.
Added
where_object_changes_fromqueries for versions where the object's attributes changed from one set of known values to any other set of values.
Fixed
- #1281 Rails:
Instead of an
Engine, PT now provides aRailtie, which is simpler. - Expand kwargs passed to
save_with_versionusing double splat operator - Rails 6.1 compatibility - #1287 - Fix 'rails db:migrate' error when run against an app with mysql2 adapter
Dependencies
- Drop support for ruby 2.4 (reached EoL on 2020-03-31)
11.0.0 (2020-08-24)
Breaking Changes
- #1221
If you use the experimental association-tracking feature, and you forget to
install the
paper_trail-association_trackinggem, then, when you calltrack_associations=you will get aNoMethodErrorinstead of the previous detailed error. Normally the removal of such a temporary warning would not be treated as a breaking change, but since this relates to PT-AT, it seemed warranted. VersionConcern#sibling_versionsis now private, and its arity has changed.
Added
- None
Fixed
-
#1242 - Generator make wrong migration for Oracle database
-
#1238 - Query optimization in
reify -
#1256 - Skip version for timestamp when changed attributed is ignored via Hash
Dependencies
- Drop support for rails <= 5.1, which [reached EOL when 6.0 was released][2]
- Drop support for ruby 2.3 (reached EOL on 2019-04-01)
10.3.1 (2019-07-31)
Breaking Changes
- None
Added
- None
Fixed
- None
Dependencies
- #1213 - Allow contributors to install incompatible versions of ActiveRecord. See discussion in paper_trail/compatibility.rb
10.2.1 (2019-03-14)
Breaking Changes
- None
Added
- None
Fixed
- #1184 - No need to calculate previous values of skipped attributes
- #1188 -
Optimized the memory allocations during the building of every particular
Version object. That can help a lot for heavy bulk processing.
In additional we advise to use
json[b]DB types forobjectandobject_changesVersion columns, in order to reach best possible RAM performance.
10.1.0 (2018-12-04)
Breaking Changes
- None
Deprecated
- #1158 - Passing
association name as
versions:option or Version class name asclass_name:options directly tohas_paper_trail. Usehas_paper_trail versions: {name: :my_name, class_name: "MyVersionModel"}instead.
Added
- #1166 -
New global option
has_paper_trail_defaults, defaults forhas_paper_trail - #1158 — Add the
ability to pass options, such as
scopeorextend:to thehas_many :versionsassociation macro. - #1172 - Support rails 6.0.0.alpha
Fixed
- None
10.0.1 (2018-09-01)
Breaking Changes
- None
Added
- None
Fixed
- #1150 - When PT-AT
is not loaded, and someone sets
track_associations = false, it shouldwarn, notraise.
10.0.0 (2018-09-01)
PT 10 tackles some tough issues that required breaking changes. We fixed a rare issue with STI, and saved major disk space in databases with tens of millions of version records. Special thanks to @lorint and @seanlinsley, respectively.
Breaking changes affecting most people
- #1132 - Removed a dozen methods deprecated in PT 9. Make sure you've addressed all deprecation warnings before upgrading.
Breaking changes affecting fewer people
- db9c392d -
paper_trail-association_trackingis no longer a runtime dependency. If you use it (track_associations = true) you must now add it to your ownGemfile. See also PT-AT #7 - #1130 -
Removed
save_changes. For those wanting to save space, it's more effective to drop theobjectcolumn. If you need ultimate control over theobject_changescolumn, you can write your ownobject_changes_adapter.
Breaking changes most people won't care about
- #1121 -
touchnow always insertsnullinobject_changes. - #1123 -
object_changesis now populated on destroy in order to makewhere_object_changesusable when you've dropped theobjectcolumn. Sean is working on an optional backport migration and will post about it in #1099 when he's done.
Added
- #1099 -
Ability to save ~50% storage space by making the
objectcolumn optional. Note that this disablesreifyandwhere_object.
Fixed
- #594 -
A rare issue with reification of STI subclasses, affecting only PT-AT users
who have a model with mutliple associations, whose foreign keys are named the
same, and whose foreign models are STI with the same parent class. This fix
requires a schema change. See docs section 4.b.1 The optional
item_subtypecolumn for instructions.
9.2.0 (2018-06-09)
Breaking Changes
- None
Added
- #1070 - The experimental associations tracking feature has been moved to a separate gem, paper_trail-association_tracking. PT will, for now, have a runtime dependency on this new gem. So, assuming the gem extraction goes well, no breaking changes are anticipated.
- #1093 -
PaperTrail.config.object_changes_adapter- Expert users can write their own adapter to control how the changes for each version are stored in the object_changes column. An example of this implementation using the hashdiff gem can be found here: paper_trail-hashdiff
Fixed
- None
9.1.1 (2018-05-30)
Breaking Changes
- None
Added
- None
Fixed
- #1098 - Fix
regression in 9.1.0 re: generator
--with-associations
9.1.0 (2018-05-23)
Breaking Changes
- None
Added
- #1091 -
PaperTrail.config.association_reify_error_behaviour- For users of the experimental association tracking feature. Starting with PT 9.0.0, reification ofhas_oneassociations is stricter. This option gives users some choices for how to handle thePaperTrail::Reifiers::HasOne::FoundMoreThanOneerror introduced in PT 9. See README section 4.b.1. "Known Issues" for more details.
Fixed
- None
9.0.2 (2018-05-14)
Breaking Changes
- None
Added
- None
Fixed
- #1084
The
touchcallback (added in 9.0.0) now inserts the correct value into theversions.objectcolumn.
Other
- Stop testing against rails 5.0, which reached EoL on 2018-04-15, when 5.2 was released, per the rails maintenance policy
9.0.0 (2018-03-26)
Breaking Changes, Major
- #1063 -
touchwill now create a version. This can be configured with the:onoption. See documentation section 2.a. "Choosing Lifecycle Events To Monitor". - Drop support for ruby 2.2, whose EoL is the end of March, 2018
- PaperTrail now uses
frozen_string_literal, so you should assume that all strings it returns are frozen. - Using
where_object_changesto read YAML from a text column will now raise error, was deprecated in 8.1.0.
Breaking Changes, Minor
- Removed deprecated
Version#originator, use#paper_trail_originator - Using paper_trail.on_destroy(:after) with ActiveRecord's belongs_to_required_by_default will produce an error instead of a warning.
- Removed the
warn_about_not_setting_whodunnitcontroller method. This will only be a problem for you if you are skipping it, eg.skip_after_action :warn_about_not_setting_whodunnit, which few people did.
Deprecated
- #1063 -
paper_trail.touch_with_versionis deprecated in favor oftouch. - #1033 - Request variables
are now set using eg.
PaperTrail.request.whodunnit=and the old way,PaperTrail.whodunnit=is deprecated.
Added
- #1067 - Add support to Rails 5.2.
- #1033 -
Set request variables temporarily using a block, eg.
PaperTrail.request(whodunnit: 'Jared') do .. end - #1037 Add
paper_trail.update_columns - #961 - Instead of crashing when misconfigured Custom Version Classes are used, an error will be raised earlier, with a much more helpful message.
- Failing to set PaperTrail.config.track_associations will no longer produce a warning. The default (false) will remain the same.
Fixed
- #1051 -
touch_with_versionshould always create a version, regardles of the:onlyoption - #1047 - A rare issue
where
touch_with_versionsaved less data than expected, but only when the update callback was not installed, eg.has_paper_trail(on: []) - #1042 - A rare issue with load order when using PT outside of rails
- #594 - Improved the error message for a very rare issue in the experimental association tracking feature involving two has_one associations, referencing STI models with the same base class, and the same foreign_key.
8.1.2 (2017-12-22)
Breaking Changes
- None
Added
- None
Fixed
- #1028 Reifying
associations will now use
base_classname instead of class name to reify STI models corrrectly.
8.0.1 (2017-10-25)
Breaking Changes
- None
Added
- None
Fixed
- #1003 - Warn when PT cannot be loaded because rails is not loaded yet.
8.0.0 (2017-10-04)
Breaking Changes
- Drop support for rails 4.0 and 4.1, whose EoL was 2016-06-30
- Drop support for ruby 2.1, whose EoL was 2017-04-01
- #803 - where_object_changes no longer supports reading json from a text column
Added
- None
Fixed
- #996 - Incorrect item_type in association reification query
7.1.3 (2017-09-19)
Breaking Changes
- None
Added
- None
Fixed
- #988 - Fix ActiveRecord
version check in
VersionConcernfor Rails 4.0
7.1.2 (2017-08-30)
Breaking Changes
- None
Added
- None
Fixed
- #985 - Fix RecordInvalid error on nil item association when belongs_to_required_by_default is enabled.
7.1.1 (2017-08-18)
Breaking Changes
- None
Added
- None
Fixed
- Stop including unnecessary files in released gem. Reduces .gem file size from 100K to 30K.
- #984 - Fix NameError suspected to be caused by autoload race condition.
7.0.3 (2017-06-01)
Breaking Changes
- None
Added
- None
Fixed
- #959 -
Add migration version (eg.
[5.1]) to all migration generators.
7.0.1 (2017-04-10)
Breaking Changes
- None
Added
- Generate cleaner migrations for databases other than MySQL
Fixed
- #949 - Inherit from the
new versioned migration class, e.g.
ActiveRecord::Migration[5.1]
7.0.0 (2017-04-01)
Breaking Changes
- Drop support for ruby 1.9.3, whose EOL was 2015-02-23
- Drop support for ruby 2.0.0, whose EOL was 2016-02-24
- Remove deprecated config methods:
- PaperTrail.serialized_attributes?
- PaperTrail.config.serialized_attributes
- PaperTrail.config.serialized_attributes=
- Sinatra integration moved to paper_trail-sinatra gem
Added
PaperTrail.gem_versionreturns aGem::Version, nice for comparisons.
Fixed
- #925 - Update RSpec matchers to work with custom version association names
- #929 - Fix error calling private method in rails 4.0
- #938 - Fix bug where non-standard foreign key names broke belongs_to associations
- #940 - When destroying versions to stay under version_limit, don't rely on the database to implicitly return the versions in the right order
6.0.2 (2016-12-13)
Breaking Changes
- None
Added
- None
Fixed
88e513f- Surprise argument modification bug inwhere_object_changesc7efd62- Column type-detection bug inwhere_object_changes- #905 - Only invoke
logger.warnifloggerinstance exists
Code Quality
- Improve Metrics/AbcSize from 30 to 22
- Improve Metrics/PerceivedComplexity from 10 to 9
6.0.1 (2016-12-04)
Breaking Changes
- None
Added
- None
Fixed
- Remove rails 3 features that are no longer supported, most notably,
protected_attributes.
6.0.0 (2016-12-03)
Now with rails 5.1 support, and less model pollution! About 40 methods that were polluting your models' namespaces have been removed, reducing the chances of a name conflict with your methods.
Breaking Changes
- #898 - Dropped support for rails 3
- #864 - The model methods
deprecated in 5.2.0 have been removed. Use
paper_trail.xinstead ofx. - #861 -
timestamp_field=removed without replacement. It is no longer configurable. The timestamp field in theversionstable must now be namedcreated_at.
Deprecated
- None
Added
- #900 - Support for rails 5.1
- #881 - Add RSpec matcher
have_a_version_with_changesfor easier testing.
Fixed
- None
5.2.0 (2016-06-27)
Breaking Changes
- None
Deprecated
- #719 - The majority of model methods. Use paper_trail.x instead of x. Why? Your models are a crowded namespace, and we want to get out of your way!
Added
- None
Fixed
- None
5.0.0 (2016-05-02)
Breaking Changes
- #758 -
PaperTrail.config.track_associationsgetter method removed, usetrack_associations?instead. - #740 -
PaperTrail.config.track_associations?now defaults to false - #723 -
PaperTrail.enabled=now affects all threads - #556 /
#301 -
If you are tracking who is responsible for changes with
whodunnit, be aware that PaperTrail no longer adds theset_paper_trail_whodunnitbefore_action for you. Please add this before_action to your ApplicationController to continue recording whodunnit. See the readme for an example. - #683 /
#682 -
Destroy callback default changed to :before to accommodate ActiveRecord 5
option
belongs_to_required_by_defaultand new Rails 5 default.
Added
- #771 - Added support for has_and_belongs_to_many associations
- #741 / #681 MySQL unicode support in migration generator
- #689 - Rails 5 compatibility
- Added a rails config option:
config.paper_trail.enabled - #503 - Support for reifying belongs_to associations.
Fixed
- #777 -
Support HMT associations with
:sourceoption. - #738 -
Rare bug where a non-versioned STI parent caused
changesetto return an empty hash. - #731 -
Map enums to database values before storing in
object_changescolumn. - #715 - Optimize post-rollback association reset.
- #701 / #699 - Cleaning old versions explicitly preserves the most recent versions instead of relying on database result ordering.
- #635 - A bug where it was not possible to disable PT when using a multi-threaded webserver.
- #584 - Fixed deprecation warning for Active Record after_callback / after_commit
4.2.0 (2016-05-31)
Breaking Changes
- None
Added
- #808 -
Warn when destroy callback is set to :after with ActiveRecord 5
option
belongs_to_required_by_defaultset totrue.
Fixed
- None
4.1.0 (2016-01-30)
Known Issues
- Version changesets now store ENUM values incorrectly (as nulls). Previously the values were stored as strings. This only affects Rails 4, not Rails 5. See #926
Breaking Changes
- None
Added
Fixed
- None
4.0.0 (2015-07-30)
This major release adds JSON column support in PostgreSQL, limited support for versioning associations, various new configuration options, and a year's worth of bug fixes. Thanks to everyone who helped test the two betas and two release candidates.
Breaking Changes
- Using a Rails initializer to reopen PaperTrail::Version or otherwise extend PaperTrail is no longer recommended. An alternative is described in the readme. See https://github.com/paper-trail-gem/paper_trail/pull/557 and https://github.com/paper-trail-gem/paper_trail/pull/492.
- If you depend on the
RSpecorCucumberhelpers, you must require them in your test helper. - #566 - Removed deprecated
methods
paper_trail_onandpaper_trail_off. Usepaper_trail_on!andpaper_trail_off!instead. - #458 - Version metadata
(the
:metaoption) from AR attributes forcreateevents will now save the current value instead ofnil. - #391 -
object_changesvalue should dump toYAMLas a normalHashinstead of anActiveSupport::HashWithIndifferentAccess. - #375 /
#374 /
#354 /
#131 -
Versions are now saved with an
after_callback, instead of abefore_callback. This ensures that the timestamp field for a version matches the corresponding timestamp in the model. 3da1f104-PaperTrail.configandPaperTrail.configureare now identical: both return thePaperTrail::Configinstance and also yield it if a block is provided.
Added
- #525 / #512 - Support for virtual accessors and redefined setter and getter methods.
- #518 - Support for
querying against PostgreSQL's
JSONandJSONBcolumn types viaPaperTrail::VersionConcern#where_objectandPaperTrail::VersionConcern#where_object_changes - #507 -
New option:
:save_changescontrols whether or not to save changes to theobject_changescolumn (if it exists). - #500 - Support for
passing an empty array to the
onoption (on: []) to disable all automatic versioning. - #494 - The install generator will warn the user if the migration they are attempting to generate already exists.
- #484 - Support for
PostgreSQL's
JSONBType for storingobjectandobject_changes. - #439 / #12 - Support for versioning associations (has many, has one, etc.) one level deep.
- #420 - Add
VersionConcern#where_object_changesinstance method; acts as a helper for querying against theobject_changescolumn in versions table. - #416 - Added a
configoption for enabling/disabling utilization ofserialized_attributesforActiveRecord, necessary becauseserialized_attributeshas been deprecated inActiveRecordversion4.2and will be removed in version5.0 - #399 - Add
:dupargument for options hash toreifywhich forces a new model instance. - #394 - Add RSpec matcher
have_a_version_withfor easier testing. - #347 - Autoload
ActiveRecordmodels in via aRails::Enginewhen the gem is used withRails.
Fixed
- #563 - Fixed a bug in
touch_with_versionso that it will still create a version even when theonoption is, e.g.[:create]. - #541 -
PaperTrail.config.enabledshould be Thread Safe - #451 - Fix
reifymethod in context of model where the base class has a default scope, and the live instance is not scoped within that default scope. - #440 -
versionsassociation should clear/reload after a transaction rollback. - #438 -
ModelKlass.paper_trail_enabled_for_model?should returnfalseifhas_paper_trailhas not been declared on the class. - #404 /
#428 -
model_instance.dupdoes not need to be invoked when examining what the instance looked like before changes were persisted, which avoids issues if a 3rd party has overriden thedupbehavior. Also fixes errors occuring when a user attempts to update the inheritance column on an STI model instance inActiveRecord4.1.x - #427 - Fix
reifymethod in context of model where a column has been removed. - #414 - Fix
functionality
ignoreargument tohas_paper_trailinActiveRecord4. - #413 - Utilize
RequestStore to ensure that
the
PaperTrail.whodunnitis set in a thread safe manner within Rails and Sinatra. - #381 - Fix
irbwarning:can't alias context from irb_context.RspecandCucumberhelpers should not be loaded by default, regardless of whether those libraries are loaded. - #248 - In MySQL, to
prevent truncation, generated migrations now use
longtextinstead oftext. - Methods handling serialized attributes should fallback to the currently set
Serializer instead of always falling back to
PaperTrail::Serializers::YAML.
Deprecated
- #479 - Deprecated
originatormethod, usepaper_trail_originator.
3.0.9
- #479 - Deprecated
originatormethod in favor ofpaper_trail_originatorDeprecation warning informs users that theoriginatorof the methods will be removed in version4.0. (Backported from v4) - Updated deprecation warnings for
Model.paper_trail_onandModel.paper_trail_offto have display correct version number the methods will be removed (4.0)
3.0.2
- #357 - If a
Versioninstance is reified and then persisted at that state, it's timestamp attributes for update should still gettouched. - #351 / #352 -
PaperTrail::Rails::Controllershould hook into all controller types, and should not get loaded unlessActionControlleris. - #346 -
user_for_paper_trailmethod should accommodate different types for return values fromcurrent_usermethod. - #344 - Gem is now tested against
MySQLandPostgreSQLin addition toSQLite. - #317 / #314 -
versionsshould default to ordering via the primary key if it is an integer to avoid timestamp comparison issues. PaperTrail::Cleaner.clean_versions!should group versions byPaperTrail.timestamp_fieldwhen deciding which ones to keep / destroy, instead of always grouping by thecreated_atfield.- If a
Versioninstance is reified and then persisted at that state, it's source version (model_instance#version_association_name, usuallymodel_instance#version) will get cleared since persisting it causes it to become the live instance. - If
destroyactions are tracked for a versioned model, invokingdestroyon the model will cause the corresponding version that gets generated to be assigned as the source version (model_instance#version_association_name, usuallymodel_instance#version).
3.0.1
- #340 - Prevent potential error encountered when using the
InstallGeneratorwith Rails4.1.0.rc1. - #334 - Add small-scope
whodunnitmethod toPaperTrail::Model::InstanceMethods. - #329 - Add
touch_with_versionmethod toPaperTrail::Model::InstanceMethods, to allow for generating a version whiletouching a model. - #328 / #326 /
#307 -
Model.paper_trail_enabled_for_model?andmodel_instance.without_versioningis now thread-safe. - #316 -
user_for_paper_trailshould default tocurrent_user.try(:id)instead ofcurrent_user(ifcurrent_useris defined). - #313 - Make the
Rails::Controllerhelper compatible withActionController::APIfor compatibility with therails-apigem. - #312 - Fix RSpec
with_versioningclass level helper method. model_instance.without_versioningnow yields themodel_instance, enabling syntax like this:model_instance.without_versioning { |obj| obj.update(:name => 'value') }.- Deprecated
Model.paper_trail_onandModel.paper_trail_offin favor of bang versions of the methods. Deprecation warning informs users that the non-bang versions of the methods will be removed in version4.0
3.0.0
- #305 -
PaperTrail::VERSIONshould be loaded at runtime. - #295 - Explicitly specify table name for version class when
querying attributes. Prevents
AmbiguousColumnerrors on certainJOINstatements. - #289 - Use
ActiveSupport::Concernfor implementation of base functionality onPaperTrail::Versionclass. Increases flexibility and makes it easier to use custom version classes with multipleActiveRecordconnections. - #288 - Change all scope declarations to class methods on the
PaperTrail::Versionclass. Fixes usability whenPaperTrail::Version.abstract_class? == true. - #287 - Support for
PostgreSQL's JSON Type for storing
objectandobject_changes. - #281 -
Rails::Controllerhelper will returnfalsefor thepaper_trail_enabled_for_controllermethod ifPaperTrail.enabled? == false. - #280 - Don't track virtual timestamp attributes.
- #278 / #272 - Make RSpec and Cucumber helpers usable with Spork and Zeus.
- #273 - Make the
onlyandignoreoptions acceptHasharguments; allows for conditional tracking. - #264 - Allow unwrapped symbol to be passed in to the
onoption. - #224/#236 - Fixed compatibility with ActsAsTaggableOn.
- #235 - Dropped unnecessary secondary sort on
versionsassociation. - #216 - Added helper & extension for RSpec, and helper for Cucumber.
- #212 - Added
PaperTrail::Cleanermodule, useful for discarding draft versions. - #207 - Versions for
'create'events are now created withcreate!instead ofcreateso that an exception gets raised if it is appropriate to do so. - #199 - Rails 4 compatibility.
- #165 - Namespaced the
Versionclass under thePaperTrailmodule. - #119 - Support for Sinatra; decoupled gem from
Rails. - Renamed the default serializers from
PaperTrail::Serializers::YamlandPaperTrail::Serializers::Jsonto the capitalized forms,PaperTrail::Serializers::YAMLandPaperTrail::Serializers::JSON. - Removed deprecated
set_whodunnitmethod from Rails Controller scope.
2.7.2
- #228 - Refactored default
user_for_paper_trailmethod implementation so thatcurrent_useronly gets invoked if it is defined. - #219 - Fixed issue where attributes stored with
nilvalue might not get reified properly depending on the way the serializer worked. - #213 - Added a
version_limitoption to thePaperTrail::Configoptions that can be used to restrict the number of versions PaperTrail will store per object instance. - #187 - Confirmed JRuby support.
- #174 - The
eventfield on the versions table can now be customized.
2.7.1
- #206 - Fixed Ruby 1.8.7 compatibility for tracking
object_changes. - #200 - Fixed
next_versionmethod so that it returns the live model when called on latest reified version of a model prior to the live model. - #197 - PaperTrail now falls back on using YAML for serialization of
serialized model attributes for storage in the
objectandobject_changescolumns in theVersiontable. This fixes compatibility forRails 3.0.xfor projects that employ theserializedeclaration on a model. - #194 - A JSON serializer is now included in the gem.
- #192 -
object_changesshould store serialized representation of serialized attributes forcreateactions (in addition toupdateactions, which had already been patched by #180). - #190 - Fixed compatibility with SerializedAttributes gem.
- #189 - Provided support for a
configureblock initializer. - Added
settermethod for theserializerconfig option.
2.7.0
- #183 - Fully qualify the
Versionclass to help prevent namespace resolution errors within other gems / plugins. - #180 - Store serialized representation of serialized attributes
on the
objectandobject_changescolumns in theVersiontable. - #164 - Allow usage of custom serializer for storage of object attributes.
2.6.4
- #181/#182 -
Controller metadata methods should only be evaluated when
paper_trail_enabled_for_controller == true. - #177/#178 -
Factored out
version_keyinto it's own method to preventConnectionNotEstablishederror from getting thrown in instances wherehas_paper_trailis declared on class prior to ActiveRecord establishing a connection. - #176 - Force metadata calls for attributes to use current value if attribute value is changing.
- #173 - Update link to diff-lcs.
- #172 - Save
object_changeson creation. - #168 - Respect conditional
:ifor:unlessarguments to thehas_paper_trailmethod fordestroyevents. - #167 - Fix
originatormethod so that it works with subclasses and STI. - #160 - Fixed failing tests and resolved out of date dependency issues.
- #157 - Refactored
class_attributenames on theClassMethodsmodule for names that are not obviously pertaining to PaperTrail to prevent method name collision.