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
- None
- None
- None
- #1221
If you use the experimental association-tracking feature, and you forget to
install the
paper_trail-association_tracking
gem, then, when you calltrack_associations=
you will get aNoMethodError
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.
- None
-
#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
- Drop support for rails <= 5.1 (reached EOL when 6.0 was released, per https://guides.rubyonrails.org/maintenance_policy.html)
- Drop support for ruby 2.3 (reached EOL on 2019-04-01)
- None
- None
- None
- #1213 - Allow contributors to install incompatible versions of ActiveRecord. See discussion in paper_trail/compatibility.rb
- None
- #1194 -
Added a 'limit' option to has_paper_trail, allowing models to override the
global
PaperTrail.config.version_limit
setting.
- #1196 -
In the installation migration, change
versions.item_id
from 4 byte integer to 8 bytes (bigint).
- None
- None
- #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 forobject
andobject_changes
Version columns, in order to reach best possible RAM performance.
- None
- Support ruby 2.6.0
- #1182 - Support rails 6.0.0.beta1
- #1177 -
Do not store ignored and skipped attributes in
object_changes
on destroy.
- #1176 -
config.paper_trail.enabled
- None
- #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. π§ββοΈ I don't think that this applies π§ π§ββοΈ
- #1166 -
New global option
has_paper_trail_defaults
, defaults forhas_paper_trail
- #1158 β Add the
ability to pass options, such as
scope
orextend:
to thehas_many :versions
association macro. - #1172 - Support rails 6.0.0.alpha
- None
- None
- None
- #1150 - When PT-AT
is not loaded, and someone sets
track_associations = false
, it shouldwarn
, notraise
.
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.
- #1132 - Removed a dozen methods deprecated in PT 9. Make sure you've addressed all deprecation warnings before upgrading.
- 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 ownGemfile
. β¬οΈ Added π§ββοΈ See also PT-AT #7 - #1130 -
Removed
save_changes
. For those wanting to save space, it's more effective to drop theobject
column. If you need ultimate control over theobject_changes
column, you can write your ownobject_changes_adapter
. β¬οΈ Skipping this π§ββοΈ
- #1121 -
touch
now always insertsnull
inobject_changes
. - #1123 -
object_changes
is now populated on destroy in order to makewhere_object_changes
usable when you've dropped theobject
column. Sean is working on an optional backport migration and will post about it in #1099 when he's done.
- #1099 -
Ability to save ~50% storage space by making the
object
column optional. Note that this disablesreify
andwhere_object
.
- #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.
- None
- #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
- None
- None
- None
- #1098 - Fix
regression in 9.1.0 re: generator
--with-associations
- None
- #1091 -
PaperTrail.config.association_reify_error_behaviour
- For users of the experimental association tracking feature. Starting with PT 9.0.0, reification ofhas_one
associations is stricter. This option gives users some choices for how to handle thePaperTrail::Reifiers::HasOne::FoundMoreThanOne
error introduced in PT 9. See README section 4.b.1. "Known Issues" for more details.
- None
- None
- None
- #1084
The
touch
callback (added in 9.0.0) now inserts the correct value into theversions.object
column.
- Stop testing against rails 5.0, which reached EoL on 2018-04-15, when 5.2 was released, per the rails maintenance policy
- None
- #1076
Add
save_with_version
, a replacement for deprecated methodtouch_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.
- None
- #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 π§ββοΈ
- 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 π§ββοΈ
- #1063 -
paper_trail.touch_with_version
is deprecated in favor oftouch
. π§ββοΈ 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 π§ββοΈ
- #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.
- #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.
- None
- None
- #1028 Reifying
associations will now use
base_class
name instead of class name to reify STI models corrrectly.
- None
- None
- #1018 Serializing postgres arrays
- None
- #997
Deprecate
where_object_changes
when reading YAML from a text column
- #1009
End generated
config/initializers/paper_trail.rb
with newline.
- None
- None
- #1003 - Warn when PT cannot be loaded because rails is not loaded yet.
- 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
- None
- #996 - Incorrect item_type in association reification query
- None
- None
- #988 - Fix ActiveRecord
version check in
VersionConcern
for Rails 4.0
- None
- None
- #985 - Fix RecordInvalid error on nil item association when belongs_to_required_by_default is enabled.
- None
- None
- 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.
- None
- #803
Deprecate
where_object_changes
when reading json from a text column - #976
PaperTrail.whodunnit
accepts aProc
- None
- None
- None
- #959 -
Add migration version (eg.
[5.1]
) to all migration generators.
- None
- #932 -
PaperTrail.whodunnit
now accepts a block.
- #956 - Fix ActiveRecord >= 5.1 version check
- None
- Generate cleaner migrations for databases other than MySQL
- #949 - Inherit from the
new versioned migration class, e.g.
ActiveRecord::Migration[5.1]
-
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. π§ββοΈ
PaperTrail.gem_version
returns aGem::Version
, nice for comparisons.
- #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
- None
- None
88e513f
- Surprise argument modification bug inwhere_object_changes
c7efd62
- Column type-detection bug inwhere_object_changes
- #905 - Only invoke
logger.warn
iflogger
instance exists
- Improve Metrics/AbcSize from 30 to 22
- Improve Metrics/PerceivedComplexity from 10 to 9
- None
- None
- Remove rails 3 features that are no longer supported, most notably,
protected_attributes
.
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.
- #898 - Dropped support for rails 3
- #864 - The model methods
deprecated in 5.2.0 have been removed. Use
paper_trail.x
instead ofx
. - #861 -
timestamp_field=
removed without replacement. It is no longer configurable. The timestamp field in theversions
table must now be namedcreated_at
. π§ββοΈ Already present π§ββοΈ
- None
- #900 - Support for rails 5.1
- #881 - Add RSpec matcher
have_a_version_with_changes
for easier testing.
- None
π§ββοΈ How it started π§ββοΈ
- None
- None
- None