Skip to content

Instantly share code, notes, and snippets.

@jmevans0211
Last active December 2, 2020 16:24
Show Gist options
  • Save jmevans0211/19a53693f91156f50af8dc6fa1b2f0eb to your computer and use it in GitHub Desktop.
Save jmevans0211/19a53693f91156f50af8dc6fa1b2f0eb to your computer and use it in GitHub Desktop.
PaperTrail Deprecation Tracking

Changelog

This project follows semver 2.0.0 and the recommendations of keepachangelog.com.

NOTES

  • audit trails table

Items to (possibly) revisit

  • 7.0.0 --> Sinatra integration moved to paper_trail-sinatra gem
  • 9.0.0 --> #1033 - Request variables are now set using eg. PaperTrail.request.whodunnit= and the old way, PaperTrail.whodunnit= is deprecated.
  • 9.0.0 --> - PaperTrail now uses frozen_string_literal, so you should assume that all strings it returns are frozen. Not sure if/how this will affect

Unreleased

Breaking Changes

  • None

Added

  • None

Fixed

  • None

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_tracking gem, then, when you call track_associations= you will get a NoMethodError instead 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. πŸ§žβ€β™€οΈ Added πŸ§žβ€β™€οΈ
  • VersionConcern#sibling_versions is 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

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.3.0 (2019-04-09)

Breaking Changes

  • None

Added

  • #1194 - Added a 'limit' option to has_paper_trail, allowing models to override the global PaperTrail.config.version_limit setting.

Fixed

  • #1196 - In the installation migration, change versions.item_id from 4 byte integer to 8 bytes (bigint).

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 for object and object_changes Version columns, in order to reach best possible RAM performance.

10.2.0 (2019-01-31)

Breaking Changes

  • None

Added

  • Support ruby 2.6.0
  • #1182 - Support rails 6.0.0.beta1

Fixed

  • #1177 - Do not store ignored and skipped attributes in object_changes on destroy.

Deprecated

  • #1176 - config.paper_trail.enabled

10.1.0 (2018-12-04)

Breaking Changes

  • None

Deprecated

  • #1158 - Passing association name as versions: option or Version class name as class_name: options directly to has_paper_trail. Use has_paper_trail versions: {name: :my_name, class_name: "MyVersionModel"} instead. πŸ§žβ€β™€οΈ I don't think that this applies 🧐 πŸ§žβ€β™€οΈ

Added

  • #1166 - New global option has_paper_trail_defaults, defaults for has_paper_trail
  • #1158 β€” Add the ability to pass options, such as scope or extend: to the has_many :versions association 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 should warn, not raise.

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_tracking is no longer a runtime dependency. If you use it (track_associations = true) you must now add it to your own Gemfile. ⬆️ Added πŸ§žβ€β™€οΈ See also PT-AT #7
  • #1130 - Removed save_changes. For those wanting to save space, it's more effective to drop the object column. If you need ultimate control over the object_changes column, you can write your own object_changes_adapter. ⬆️ Skipping this πŸ§žβ€β™€οΈ

Breaking changes most people won't care about

  • #1121 - touch now always inserts null in object_changes.
  • #1123 - object_changes is now populated on destroy in order to make where_object_changes usable when you've dropped the object column. 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 object column optional. Note that this disables reify and where_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_subtype column 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 of has_one associations is stricter. This option gives users some choices for how to handle the PaperTrail::Reifiers::HasOne::FoundMoreThanOne error 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 touch callback (added in 9.0.0) now inserts the correct value into the versions.object column.

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.1 (2018-04-23)

Breaking Changes

  • None

Added

  • #1076 Add save_with_version, a replacement for deprecated method touch_with_version. Not exactly the same, it's a save, not a touch.
  • #1074 PaperTrail.request do ... end now returns the value the given block.

Fixed

  • None

9.0.0 (2018-03-26)

Breaking Changes, Major

  • #1063 - touch will now create a version. This can be configured with the :on option. See documentation section 2.a. "Choosing Lifecycle Events To Monitor". πŸ§žβ€β™€οΈ did not find in code πŸ§žβ€β™€οΈ
  • 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. πŸ§žβ€β™€οΈ not sure how to check for this πŸ§žβ€β™€οΈ
  • Using where_object_changes to read YAML from a text column will now raise error, was deprecated in 8.1.0. πŸ§žβ€β™€οΈ did not find in code πŸ§žβ€β™€οΈ

Breaking Changes, Minor

  • Removed deprecated Version#originator, use #paper_trail_originator πŸ§žβ€β™€οΈ did not find instances of either in code πŸ§žβ€β™€οΈ
  • 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_whodunnit controller 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. πŸ§žβ€β™€οΈ instances of this deleted. 3 in total πŸ§žβ€β™€οΈ

Deprecated

  • #1063 - paper_trail.touch_with_version is deprecated in favor of touch. πŸ§žβ€β™€οΈ No instances of this found πŸ§žβ€β™€οΈ
  • #1033 - Request variables are now set using eg. PaperTrail.request.whodunnit= and the old way, PaperTrail.whodunnit= is deprecated. πŸ§žβ€β™€οΈ Updated πŸ§žβ€β™€οΈ

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_version should always create a version, regardles of the :only option
  • #1047 - A rare issue where touch_with_version saved 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_class name instead of class name to reify STI models corrrectly.

8.1.1 (2017-12-10)

Breaking Changes

  • None

Added

  • None

Fixed

  • #1018 Serializing postgres arrays

8.1.0 (2017-11-30)

Breaking Changes

  • None

Added

  • #997 Deprecate where_object_changes when reading YAML from a text column

Fixed

  • #1009 End generated config/initializers/paper_trail.rb with newline.

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 VersionConcern for 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.1.0 (2017-07-09)

Breaking Changes

  • None

Added

  • #803 Deprecate where_object_changes when reading json from a text column
  • #976 PaperTrail.whodunnit accepts a Proc

Fixed

  • None

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.2 (2017-04-26)

Breaking Changes

  • None

Added

  • #932 - PaperTrail.whodunnit now accepts a block.

Fixed

  • #956 - Fix ActiveRecord >= 5.1 version check

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

    πŸ§žβ€β™€οΈ No action taken!!! πŸ§žβ€β™€οΈ πŸ§žβ€β™€οΈ serialized_attributes config methods not present in app πŸ§žβ€β™€οΈ πŸ§žβ€β™€οΈ Sinatra is not in the Gemfile. For now, not adding this gem. πŸ§žβ€β™€οΈ

Added

  • PaperTrail.gem_version returns a Gem::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 in where_object_changes
  • c7efd62 - Column type-detection bug in where_object_changes
  • #905 - Only invoke logger.warn if logger instance 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.x instead of x.
  • #861 - timestamp_field= removed without replacement. It is no longer configurable. The timestamp field in the versions table must now be named created_at. πŸ§žβ€β™€οΈ Already present πŸ§žβ€β™€οΈ

Deprecated

  • None

Added

  • #900 - Support for rails 5.1
  • #881 - Add RSpec matcher have_a_version_with_changes for easier testing.

Fixed

  • None

5.2.3 (2016-11-29)

πŸ§žβ€β™€οΈ How it started πŸ§žβ€β™€οΈ

Breaking Changes

  • None

Deprecated

  • None

Added

  • None

Fixed

  • #889 - Fix warning message in instances when a version can't be persisted due to validation errors.
  • #868 Fix usage of find_by_id when primary key is not id, affecting reifying certain records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment