2016-09-02 18:37:46 -04:00
# Changelog
This project follows [semver 2.0.0 ](http://semver.org/spec/v2.0.0.html ) and the
recommendations of [keepachangelog.com ](http://keepachangelog.com/ ).
2018-09-01 16:30:47 -04:00
## Unreleased
### Breaking Changes
- None
### Added
- None
### Fixed
- None
## 10.0.0 (2018-09-01)
2018-03-26 21:42:13 -04:00
2018-08-14 02:17:35 -04:00
PT 10 tackles some tough issues that required breaking changes. We fixed a
2018-09-01 16:30:47 -04:00
rare issue with STI, and saved major disk space in databases with tens
2018-08-14 02:17:35 -04:00
of millions of version records. Special thanks to @lorint and @seanlinsley ,
respectively.
### Breaking changes affecting most people
- [#1132 ](https://github.com/paper-trail-gem/paper_trail/pull/1132 ) - Removed a
dozen methods deprecated in PT 9. Make sure you've addressed all deprecation
warnings before upgrading.
### Breaking changes affecting fewer people
2018-03-26 21:42:13 -04:00
2018-09-01 16:30:47 -04:00
- [db9c392d ](https://github.com/paper-trail-gem/paper_trail/commit/db9c392d ) -
`paper_trail-association_tracking` is no longer a runtime dependency. If you
2018-08-14 02:17:35 -04:00
use it (`track_associations = true`) you must now add it to your own `Gemfile` .
2018-09-01 16:30:47 -04:00
See also [PT-AT #7 ](https://github.com/westonganger/paper_trail-association_tracking/issues/7 )
2018-08-14 02:17:35 -04:00
- [#1130 ](https://github.com/paper-trail-gem/paper_trail/pull/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` .
### Breaking changes most people won't care about
2018-08-01 22:45:50 -04:00
- [#1121 ](https://github.com/paper-trail-gem/paper_trail/issues/1121 ) -
`touch` now always inserts `null` in `object_changes` .
2018-08-14 02:17:35 -04:00
- [#1123 ](https://github.com/paper-trail-gem/paper_trail/pull/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 ](https://github.com/paper-trail-gem/paper_trail/issues/1099 ) when
he's done.
2018-03-26 21:42:13 -04:00
### Added
2018-07-24 11:04:53 -04:00
- [#1099 ](https://github.com/paper-trail-gem/paper_trail/issues/1099 ) -
Ability to save ~50% storage space by making the `object` column optional.
Note that this disables `reify` and `where_object` .
2018-06-09 22:59:32 -04:00
### Fixed
2018-08-14 02:17:35 -04:00
- [#594 ](https://github.com/paper-trail-gem/paper_trail/issues/594 ) -
2018-08-26 21:56:26 -04:00
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](https://github.com/paper-trail-gem/paper_trail#4b-associations) for
instructions.
2018-06-09 22:59:32 -04:00
## 9.2.0 (2018-06-09)
### Breaking Changes
- None
### Added
- [#1070 ](https://github.com/paper-trail-gem/paper_trail/issues/1070 ) -
The experimental associations tracking feature has been moved to a separate
gem, [paper_trail-association_tracking]
(https://github.com/westonganger/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.
2018-05-21 07:31:05 -04:00
- [#1093 ](https://github.com/paper-trail-gem/paper_trail/pull/1093 ) -
2018-06-09 22:59:32 -04:00
`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:
2018-05-21 07:31:05 -04:00
[paper_trail-hashdiff ](https://github.com/hashwin/paper_trail-hashdiff )
2018-05-23 13:59:04 -04:00
### Fixed
- None
2018-05-30 19:47:51 -04:00
## 9.1.1 (2018-05-30)
### Breaking Changes
- None
### Added
- None
### Fixed
- [#1098 ](https://github.com/paper-trail-gem/paper_trail/pull/1098 ) - Fix
regression in 9.1.0 re: generator `--with-associations`
2018-05-23 13:59:04 -04:00
## 9.1.0 (2018-05-23)
### Breaking Changes
- None
### Added
- [#1091 ](https://github.com/paper-trail-gem/paper_trail/pull/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.
2018-04-23 00:33:52 -04:00
### Fixed
2018-05-14 21:20:23 -04:00
- None
## 9.0.2 (2018-05-14)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-14 12:26:32 -04:00
- [#1084 ](https://github.com/paper-trail-gem/paper_trail/pull/1084 )
The `touch` callback (added in 9.0.0) now inserts the correct value into
the `versions.object` column.
2018-04-23 00:33:52 -04:00
2018-05-14 12:45:49 -04:00
### Other
- Stop testing against rails 5.0, which reached EoL on 2018-04-15, when 5.2
was released, per the [rails maintenance
policy](http://guides.rubyonrails.org/maintenance_policy.html)
2018-04-23 00:33:52 -04:00
## 9.0.1 (2018-04-23)
### Breaking Changes
- None
### Added
2018-05-09 07:25:56 -04:00
- [#1076 ](https://github.com/paper-trail-gem/paper_trail/issues/1076 )
2018-04-22 23:29:01 -04:00
Add `save_with_version` , a replacement for deprecated method
`touch_with_version` . Not exactly the same, it's a save, not a touch.
2018-05-09 07:25:56 -04:00
- [#1074 ](https://github.com/paper-trail-gem/paper_trail/pull/1074 )
2018-04-12 01:50:41 -04:00
`PaperTrail.request do ... end` now returns the value the given block.
2018-03-26 21:42:13 -04:00
### Fixed
- None
## 9.0.0 (2018-03-26)
2017-10-27 12:31:04 -04:00
2018-02-01 12:04:50 -05:00
### Breaking Changes, Major
2017-10-27 12:31:04 -04:00
2018-05-09 07:25:56 -04:00
- [#1063 ](https://github.com/paper-trail-gem/paper_trail/pull/1063 ) - `touch` will now
2018-03-16 18:42:36 -04:00
create a version. This can be configured with the `:on` option. See
documentation section 2.a. "Choosing Lifecycle Events To Monitor".
2017-12-10 22:53:39 -05:00
- Drop support for ruby 2.2, [whose EoL is the end of March,
2018](https://www.ruby-lang.org/en/news/2017/09/14/ruby-2-2-8-released/)
2018-02-01 12:04:50 -05:00
- PaperTrail now uses `frozen_string_literal` , so you should assume that all
strings it returns are frozen.
- Using `where_object_changes` to read YAML from a text column will now raise
error, was deprecated in 8.1.0.
### Breaking Changes, Minor
2017-12-10 21:29:49 -05:00
- Removed deprecated `Version#originator` , use `#paper_trail_originator`
2017-10-27 12:31:04 -04:00
- Using paper_trail.on_destroy(:after) with ActiveRecord's
belongs_to_required_by_default will produce an error instead of a warning.
2018-03-04 00:24:11 -05:00
- 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.
2017-10-27 12:31:04 -04:00
2018-02-01 12:04:50 -05:00
### Deprecated
2018-05-09 07:25:56 -04:00
- [#1063 ](https://github.com/paper-trail-gem/paper_trail/pull/1063 ) -
2018-03-16 18:42:36 -04:00
`paper_trail.touch_with_version` is deprecated in favor of `touch` .
2018-05-09 07:25:56 -04:00
- [#1033 ](https://github.com/paper-trail-gem/paper_trail/pull/1033 ) - Request variables
2018-02-01 12:04:50 -05:00
are now set using eg. `PaperTrail.request.whodunnit=` and the old way,
`PaperTrail.whodunnit=` is deprecated.
2017-11-30 21:04:29 -05:00
### Added
2018-05-09 07:25:56 -04:00
- [#1067 ](https://github.com/paper-trail-gem/paper_trail/pull/1033 ) -
2018-03-20 11:25:13 -04:00
Add support to Rails 5.2.
2018-05-09 07:25:56 -04:00
- [#1033 ](https://github.com/paper-trail-gem/paper_trail/pull/1033 ) -
2018-02-01 12:04:50 -05:00
Set request variables temporarily using a block, eg.
`PaperTrail.request(whodunnit: 'Jared') do .. end`
2018-05-09 07:25:56 -04:00
- [#1037 ](https://github.com/paper-trail-gem/paper_trail/pull/1037 ) Add `paper_trail.update_columns`
- [#961 ](https://github.com/paper-trail-gem/paper_trail/issues/961 ) - Instead of
2018-01-22 00:09:03 -05:00
crashing when misconfigured Custom Version Classes are used, an error will be
raised earlier, with a much more helpful message.
2018-02-01 12:04:50 -05:00
- Failing to set PaperTrail.config.track_associations will no longer produce
a warning. The default (false) will remain the same.
2017-11-30 21:04:29 -05:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#1051 ](https://github.com/paper-trail-gem/paper_trail/issues/1051 ) - `touch_with_version`
2018-03-11 00:23:07 -05:00
should always create a version, regardles of the `:only` option
2018-05-09 07:25:56 -04:00
- [#1047 ](https://github.com/paper-trail-gem/paper_trail/issues/1047 ) - A rare issue
2018-03-04 01:54:46 -05:00
where `touch_with_version` saved less data than expected, but only when the
update callback was not installed, eg. `has_paper_trail(on: [])`
2018-05-09 07:25:56 -04:00
- [#1042 ](https://github.com/paper-trail-gem/paper_trail/issues/1042 ) - A rare issue
2018-01-31 12:25:31 -05:00
with load order when using PT outside of rails
2018-05-09 07:25:56 -04:00
- [#594 ](https://github.com/paper-trail-gem/paper_trail/issues/594 ) - Improved the
2018-03-23 23:30:45 -04:00
error message for a very rare issue in the experimental association tracking
2018-03-11 03:03:52 -04:00
feature involving two has_one associations, referencing STI models with the
same base class, and the same foreign_key.
2017-11-30 21:04:29 -05:00
2018-01-08 08:31:32 -05:00
## 8.1.2 (2017-12-22)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#1028 ](https://github.com/paper-trail-gem/paper_trail/pull/1028 ) Reifying
2018-01-08 08:31:32 -05:00
associations will now use `base_class` name instead of class name
to reify STI models corrrectly.
2017-12-10 21:14:23 -05:00
## 8.1.1 (2017-12-10)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#1018 ](https://github.com/paper-trail-gem/paper_trail/pull/1018 )
2017-12-10 21:14:23 -05:00
Serializing postgres arrays
2017-11-30 21:04:29 -05:00
## 8.1.0 (2017-11-30)
2016-12-03 20:24:16 -05:00
### Breaking Changes
2017-10-04 22:12:52 -04:00
- None
### Added
2018-05-09 07:25:56 -04:00
- [#997 ](https://github.com/paper-trail-gem/paper_trail/pull/997 )
2017-10-23 13:07:27 -04:00
Deprecate `where_object_changes` when reading YAML from a text column
2017-10-04 22:12:52 -04:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#1009 ](https://github.com/paper-trail-gem/paper_trail/pull/1009 )
2017-11-16 11:56:36 -05:00
End generated `config/initializers/paper_trail.rb` with newline.
2017-10-25 12:37:35 -04:00
## 8.0.1 (2017-10-25)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#1003 ](https://github.com/paper-trail-gem/paper_trail/pull/1003 ) - Warn when PT
2017-10-19 09:03:31 -04:00
cannot be loaded because rails is not loaded yet.
2017-10-04 22:12:52 -04:00
## 8.0.0 (2017-10-04)
### Breaking Changes
2017-09-20 05:09:41 -04:00
- Drop support for rails 4.0 and 4.1, whose EoL was
[2016-06-30 ](http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final/ )
- Drop support for ruby 2.1, whose EoL was [2017-04-01 ](http://bit.ly/2ppWDYa )
2018-05-09 07:25:56 -04:00
- [#803 ](https://github.com/paper-trail-gem/paper_trail/issues/803 ) -
2017-09-20 03:53:51 -04:00
where_object_changes no longer supports reading json from a text column
2017-04-01 03:05:50 -04:00
### Added
2017-07-09 02:00:52 -04:00
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#996 ](https://github.com/paper-trail-gem/paper_trail/pull/996 ) - Incorrect
2017-10-04 22:12:52 -04:00
item_type in association reification query
2017-09-19 01:42:20 -04:00
## 7.1.3 (2017-09-19)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#988 ](https://github.com/paper-trail-gem/paper_trail/pull/988 ) - Fix ActiveRecord
2017-09-07 16:47:11 -04:00
version check in `VersionConcern` for Rails 4.0
2017-08-30 21:12:03 -04:00
## 7.1.2 (2017-08-30)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#985 ](https://github.com/paper-trail-gem/paper_trail/pull/985 ) - Fix RecordInvalid
2017-08-30 21:12:03 -04:00
error on nil item association when belongs_to_required_by_default is enabled.
2017-08-18 11:36:02 -04:00
## 7.1.1 (2017-08-18)
### Breaking Changes
- None
### Added
- None
### Fixed
2017-07-09 02:15:38 -04:00
- Stop including unnecessary files in released gem. Reduces .gem file size
from 100K to 30K.
2018-05-09 07:25:56 -04:00
- [#984 ](https://github.com/paper-trail-gem/paper_trail/pull/984 ) - Fix NameError
2017-08-18 11:23:58 -04:00
suspected to be caused by autoload race condition.
2017-07-09 02:00:52 -04:00
## 7.1.0 (2017-07-09)
### Breaking Changes
- None
### Added
2018-05-09 07:25:56 -04:00
- [#803 ](https://github.com/paper-trail-gem/paper_trail/issues/803 )
2017-07-08 23:26:03 -04:00
Deprecate `where_object_changes` when reading json from a text column
2018-05-09 07:25:56 -04:00
- [#976 ](https://github.com/paper-trail-gem/paper_trail/pull/976 )
2017-07-08 16:39:04 -04:00
`PaperTrail.whodunnit` accepts a `Proc`
2017-04-26 13:58:58 -04:00
### Fixed
- None
2017-06-01 15:08:32 -04:00
## 7.0.3 (2017-06-01)
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#959 ](https://github.com/paper-trail-gem/paper_trail/pull/959 ) -
2017-06-01 15:08:32 -04:00
Add migration version (eg. `[5.1]` ) to all migration generators.
2017-04-26 13:58:58 -04:00
## 7.0.2 (2017-04-26)
### Breaking Changes
- None
### Added
2018-05-09 07:25:56 -04:00
- [#932 ](https://github.com/paper-trail-gem/paper_trail/pull/932 ) -
2017-02-28 21:12:20 -05:00
`PaperTrail.whodunnit` now accepts a block.
2017-04-10 12:01:13 -04:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#956 ](https://github.com/paper-trail-gem/paper_trail/pull/956 ) -
2017-06-01 15:08:32 -04:00
Fix ActiveRecord >= 5.1 version check
2017-04-10 12:01:13 -04:00
## 7.0.1 (2017-04-10)
### Breaking Changes
- None
### Added
2017-04-10 11:35:18 -04:00
- Generate cleaner migrations for databases other than MySQL
2017-04-01 03:05:50 -04:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#949 ](https://github.com/paper-trail-gem/paper_trail/issues/949 ) - Inherit from the
2017-04-10 11:10:15 -04:00
new versioned migration class, e.g. `ActiveRecord::Migration[5.1]`
2017-04-01 03:05:50 -04:00
## 7.0.0 (2017-04-01)
### Breaking Changes
2016-12-30 11:47:50 -05:00
- 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
2017-03-03 11:54:48 -05:00
- Remove deprecated config methods:
- PaperTrail.serialized_attributes?
- PaperTrail.config.serialized_attributes
- PaperTrail.config.serialized_attributes=
2017-03-28 12:45:18 -04:00
- Sinatra integration moved to
[paper_trail-sinatra ](https://github.com/jaredbeck/paper_trail-sinatra ) gem
2016-12-03 20:24:16 -05:00
### Added
2017-04-01 01:19:54 -04:00
- `PaperTrail.gem_version` returns a `Gem::Version` , nice for comparisons.
2016-12-03 20:24:16 -05:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#925 ](https://github.com/paper-trail-gem/paper_trail/pull/925 ) - Update RSpec
2017-02-06 12:54:07 -05:00
matchers to work with custom version association names
2018-05-09 07:25:56 -04:00
- [#929 ](https://github.com/paper-trail-gem/paper_trail/pull/929 ) -
2017-03-07 13:23:51 -05:00
Fix error calling private method in rails 4.0
2018-05-09 07:25:56 -04:00
- [#938 ](https://github.com/paper-trail-gem/paper_trail/pull/938 ) - Fix bug where
2017-03-26 00:39:05 -04:00
non-standard foreign key names broke belongs_to associations
2018-05-09 07:25:56 -04:00
- [#940 ](https://github.com/paper-trail-gem/paper_trail/pull/940 ) - When destroying
2017-03-27 14:54:38 -04:00
versions to stay under version_limit, don't rely on the database to
implicitly return the versions in the right order
2016-12-13 23:09:50 -05:00
## 6.0.2 (2016-12-13)
### Breaking Changes
- None
### Added
- None
### Fixed
2016-12-11 03:42:08 -05:00
- `88e513f` - Surprise argument modification bug in `where_object_changes`
- `c7efd62` - Column type-detection bug in `where_object_changes`
2018-05-09 07:25:56 -04:00
- [#905 ](https://github.com/paper-trail-gem/paper_trail/pull/905 ) - Only invoke
2016-12-05 18:21:15 -05:00
`logger.warn` if `logger` instance exists
2016-12-03 20:24:16 -05:00
2016-12-13 23:09:50 -05:00
### Code Quality
- Improve Metrics/AbcSize from 30 to 22
- Improve Metrics/PerceivedComplexity from 10 to 9
2016-12-04 17:13:20 -05:00
## 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` .
2016-12-03 20:24:16 -05:00
## 6.0.0 (2016-12-03)
2016-09-02 18:37:46 -04:00
2016-12-03 18:00:17 -05:00
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.
2016-11-27 20:47:03 -05:00
2016-09-02 18:37:46 -04:00
### Breaking Changes
2018-05-09 07:25:56 -04:00
- [#898 ](https://github.com/paper-trail-gem/paper_trail/pull/898 ) - Dropped support
2016-12-03 18:00:17 -05:00
for rails 3
2018-05-09 07:25:56 -04:00
- [#864 ](https://github.com/paper-trail-gem/paper_trail/pull/864 ) - The model methods
2016-11-22 13:41:35 -05:00
deprecated in 5.2.0 have been removed. Use `paper_trail.x` instead of `x` .
2018-05-09 07:25:56 -04:00
- [#861 ](https://github.com/paper-trail-gem/paper_trail/pull/861 ) - `timestamp_field=`
2016-11-22 13:41:35 -05:00
removed without replacement. It is no longer configurable. The
2016-09-04 00:33:29 -04:00
timestamp field in the `versions` table must now be named `created_at` .
2016-09-02 18:37:46 -04:00
### Deprecated
- None
### Added
2018-05-09 07:25:56 -04:00
- [#900 ](https://github.com/paper-trail-gem/paper_trail/pull/900/files ) -
2016-12-03 18:00:17 -05:00
Support for rails 5.1
2018-05-09 07:25:56 -04:00
- [#881 ](https://github.com/paper-trail-gem/paper_trail/pull/881 ) - Add RSpec matcher
2016-10-18 12:16:27 -04:00
`have_a_version_with_changes` for easier testing.
2016-09-02 18:37:46 -04:00
### Fixed
2016-11-29 16:32:56 -05:00
- None
## 5.2.3 (2016-11-29)
### Breaking Changes
- None
### Deprecated
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#889 ](https://github.com/paper-trail-gem/paper_trail/pull/889 ) -
2016-11-26 00:04:19 -05:00
Fix warning message in instances when a version can't be persisted due to validation errors.
2018-05-09 07:25:56 -04:00
- [#868 ](https://github.com/paper-trail-gem/paper_trail/pull/868 )
2016-09-28 17:59:47 -04:00
Fix usage of find_by_id when primary key is not id, affecting reifying certain records.
2016-11-29 16:32:56 -05:00
2016-09-08 12:29:24 -04:00
## 5.2.2 (2016-09-08)
### Breaking Changes
- None
### Deprecated
2018-05-09 07:25:56 -04:00
- [#863 ](https://github.com/paper-trail-gem/paper_trail/pull/863 ) -
2016-09-08 12:29:24 -04:00
PaperTrail.timestamp_field= deprecated without replacement.
2018-05-09 07:25:56 -04:00
See [#861 ](https://github.com/paper-trail-gem/paper_trail/pull/861 ) for discussion.
2016-09-08 12:29:24 -04:00
### Added
- None
### Fixed
2016-12-01 11:01:43 -05:00
- None
2016-09-02 18:37:46 -04:00
## 5.2.1 (2016-09-02)
2016-06-27 01:22:47 -04:00
### Breaking Changes
- None
### Deprecated
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#857 ](https://github.com/paper-trail-gem/paper_trail/pull/857 ) -
2016-09-02 17:49:08 -04:00
Fix deserialization of enums written by PT 4.
2018-05-09 07:25:56 -04:00
- [#798 ](https://github.com/paper-trail-gem/paper_trail/issues/798 ) -
2016-08-14 00:24:13 -04:00
Fix a rare bug with serialization of enums in rails 4.2 only when
using `touch_with_version` .
2016-06-27 01:22:47 -04:00
## 5.2.0 (2016-06-27)
2016-05-31 19:53:29 -04:00
### Breaking Changes
- None
2016-02-23 17:59:14 -05:00
### Deprecated
2018-05-09 07:25:56 -04:00
- [#719 ](https://github.com/paper-trail-gem/paper_trail/pull/719 ) -
2016-02-23 17:59:14 -05:00
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!
2016-05-31 19:53:29 -04:00
### Added
- None
### Fixed
- None
## 5.1.1 (2016-05-31)
2016-05-20 19:19:29 -04:00
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#813 ](https://github.com/paper-trail-gem/paper_trail/pull/813 ) -
2016-05-31 19:53:29 -04:00
Warning for paper_trail_on_destroy(:after) for pre-releases of AR 5
2018-05-09 07:25:56 -04:00
- [#651 ](https://github.com/paper-trail-gem/paper_trail/issues/651 ) -
2016-05-26 14:17:20 -04:00
Bug with installing PT on MySQL < = 5.6
2016-05-20 19:19:29 -04:00
## 5.1.0 (2016-05-20)
2016-05-10 22:43:43 -04:00
### Breaking Changes
- None
### Added
2018-05-09 07:25:56 -04:00
- [#809 ](https://github.com/paper-trail-gem/paper_trail/pull/809 ) -
2016-05-18 12:34:10 -04:00
Print warning if version cannot be saved.
2016-05-10 22:43:43 -04:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#812 ](https://github.com/paper-trail-gem/paper_trail/pull/812 ) -
2016-05-18 07:15:28 -04:00
Issue with saving HABTM associated objects using accepts_nested_attributes_for
2018-05-09 07:25:56 -04:00
- [#811 ](https://github.com/paper-trail-gem/paper_trail/pull/811 ) -
2016-05-20 00:28:40 -04:00
Avoid unnecessary query in #record_destroy
2016-05-18 12:34:10 -04:00
- Improvements to documentation
2016-05-10 22:43:43 -04:00
2016-05-04 18:20:36 -04:00
## 5.0.1 (2016-05-04)
2016-05-04 13:19:30 -04:00
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#791 ](https://github.com/paper-trail-gem/paper_trail/issues/791 ) -
2016-05-04 13:19:30 -04:00
A rare issue in applications that override `warn` .
2018-05-09 07:25:56 -04:00
- [#789 ](https://github.com/paper-trail-gem/paper_trail/issues/789 ) -
2016-05-04 15:47:49 -04:00
A potentially common issue, in applications with initializers that use
versioned models.
2016-05-04 13:19:30 -04:00
2016-05-02 12:19:18 -04:00
## 5.0.0 (2016-05-02)
2015-06-28 00:00:33 -04:00
2015-10-31 21:22:40 -04:00
### Breaking Changes
2015-06-28 00:00:33 -04:00
2018-05-09 07:25:56 -04:00
- [#758 ](https://github.com/paper-trail-gem/paper_trail/pull/758 ) -
2016-04-08 01:14:01 -04:00
`PaperTrail.config.track_associations` getter method removed,
use `track_associations?` instead.
2018-05-09 07:25:56 -04:00
- [#740 ](https://github.com/paper-trail-gem/paper_trail/issues/740 ) -
2016-04-26 22:06:22 -04:00
`PaperTrail.config.track_associations?` now defaults to false
2018-05-09 07:25:56 -04:00
- [#723 ](https://github.com/paper-trail-gem/paper_trail/pull/723 ) -
2016-03-05 16:23:42 -05:00
`PaperTrail.enabled=` now affects all threads
2018-05-09 07:25:56 -04:00
- [#556 ](https://github.com/paper-trail-gem/paper_trail/pull/556 ) /
[#301 ](https://github.com/paper-trail-gem/paper_trail/issues/301 ) -
2015-09-30 13:37:50 -04:00
If you are tracking who is responsible for changes with `whodunnit` , be aware
2016-09-02 21:49:17 -04:00
that PaperTrail no longer adds the `set_paper_trail_whodunnit` before_action
for you. Please add this before_action to your ApplicationController to
2015-06-28 00:00:33 -04:00
continue recording whodunnit. See the readme for an example.
2018-05-09 07:25:56 -04:00
- [#683 ](https://github.com/paper-trail-gem/paper_trail/pull/683 ) /
[#682 ](https://github.com/paper-trail-gem/paper_trail/issues/682 ) -
2016-01-02 11:51:02 -05:00
Destroy callback default changed to :before to accommodate ActiveRecord 5
option `belongs_to_required_by_default` and new Rails 5 default.
2015-06-28 00:00:33 -04:00
### Added
2018-05-09 07:25:56 -04:00
- [#771 ](https://github.com/paper-trail-gem/paper_trail/pull/771 ) -
2016-04-05 05:37:24 -04:00
Added support for has_and_belongs_to_many associations
2018-05-09 07:25:56 -04:00
- [#741 ](https://github.com/paper-trail-gem/paper_trail/issues/741 ) /
[#681 ](https://github.com/paper-trail-gem/paper_trail/pull/681 )
2016-03-31 17:16:47 -04:00
MySQL unicode support in migration generator
2018-05-09 07:25:56 -04:00
- [#689 ](https://github.com/paper-trail-gem/paper_trail/pull/689 ) -
2016-01-11 22:07:57 -05:00
Rails 5 compatibility
2016-01-16 16:48:27 -05:00
- Added a rails config option: `config.paper_trail.enabled`
2018-05-09 07:25:56 -04:00
- [#503 ](https://github.com/paper-trail-gem/paper_trail/pull/730 ) -
2016-03-29 22:57:17 -04:00
Support for reifying belongs_to associations.
2015-06-28 00:00:33 -04:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#777 ](https://github.com/paper-trail-gem/paper_trail/issues/777 ) -
2016-04-17 15:33:38 -04:00
Support HMT associations with `:source` option.
2018-05-09 07:25:56 -04:00
- [#738 ](https://github.com/paper-trail-gem/paper_trail/issues/738 ) -
2016-05-01 00:47:57 -04:00
Rare bug where a non-versioned STI parent caused `changeset` to
return an empty hash.
2018-05-09 07:25:56 -04:00
- [#731 ](https://github.com/paper-trail-gem/paper_trail/pull/731 ) -
2016-03-13 16:02:43 -04:00
Map enums to database values before storing in `object_changes` column.
2018-05-09 07:25:56 -04:00
- [#715 ](https://github.com/paper-trail-gem/paper_trail/issues/715 ) -
2016-03-06 14:05:21 -05:00
Optimize post-rollback association reset.
2018-05-09 07:25:56 -04:00
- [#701 ](https://github.com/paper-trail-gem/paper_trail/pull/701 ) /
[#699 ](https://github.com/paper-trail-gem/paper_trail/issues/699 ) -
2016-01-16 21:48:48 -05:00
Cleaning old versions explicitly preserves the most recent
versions instead of relying on database result ordering.
2018-05-09 07:25:56 -04:00
- [#635 ](https://github.com/paper-trail-gem/paper_trail/issues/635 ) -
2016-03-05 16:23:42 -05:00
A bug where it was not possible to disable PT when using a multi-threaded
webserver.
2018-05-09 07:25:56 -04:00
- [#584 ](https://github.com/paper-trail-gem/paper_trail/issues/584 ) -
2016-01-16 16:48:27 -05:00
Fixed deprecation warning for Active Record after_callback / after_commit
2015-06-28 00:00:33 -04:00
2016-05-31 20:10:03 -04:00
## 4.2.0 (2016-05-31)
### Breaking Changes
- None
### Added
2018-05-09 07:25:56 -04:00
- [#808 ](https://github.com/paper-trail-gem/paper_trail/pull/808 ) -
2016-05-31 20:10:03 -04:00
Warn when destroy callback is set to :after with ActiveRecord 5
option `belongs_to_required_by_default` set to `true` .
### Fixed
- None
2016-02-07 00:05:44 -05:00
## 4.1.0 (2016-01-30)
2015-08-03 15:57:36 -04:00
2017-02-08 08:56:06 -05:00
### Known Issues
2018-05-09 07:25:56 -04:00
- 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 ](https://github.com/paper-trail-gem/paper_trail/pull/926 )
2017-02-08 08:56:06 -05:00
2015-10-31 21:22:40 -04:00
### Breaking Changes
2015-08-03 15:57:36 -04:00
2015-10-31 21:22:40 -04:00
- None
2015-08-03 15:57:36 -04:00
### Added
2015-10-10 00:13:45 -04:00
- A way to control the order of AR callbacks.
2018-05-09 07:25:56 -04:00
[#614 ](https://github.com/paper-trail-gem/paper_trail/pull/614 )
2015-08-03 15:57:36 -04:00
- Added `unversioned_attributes` option to `reify` .
2018-05-09 07:25:56 -04:00
[#579 ](https://github.com/paper-trail-gem/paper_trail/pull/579 )
2015-08-03 15:57:36 -04:00
### Fixed
2015-12-13 21:36:49 -05:00
- None
2015-08-03 15:57:36 -04:00
2016-02-07 00:05:44 -05:00
## 4.0.2 (2016-01-19)
2016-01-18 16:59:10 -05:00
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#696 ](https://github.com/paper-trail-gem/paper_trail/issues/696 ) /
[#697 ](https://github.com/paper-trail-gem/paper_trail/pull/697 )
2016-01-18 16:59:10 -05:00
Bind JSON query parameters in `where_object` and `where_object_changes` .
2016-02-07 00:05:44 -05:00
## 4.0.1 (2015-12-14)
2015-11-08 21:14:39 -05:00
### Breaking Changes
- None
### Added
- None
### Fixed
2018-05-09 07:25:56 -04:00
- [#636 ](https://github.com/paper-trail-gem/paper_trail/issues/636 ) -
2015-11-08 21:14:39 -05:00
Should compile assets without a db connection
2018-05-09 07:25:56 -04:00
- [#589 ](https://github.com/paper-trail-gem/paper_trail/pull/589 ) /
[#588 ](https://github.com/paper-trail-gem/paper_trail/issues/588 ) -
2015-12-13 21:36:49 -05:00
Fixes timestamp for "create" versions
2015-11-08 21:14:39 -05:00
2016-02-07 00:05:44 -05:00
## 4.0.0 (2015-07-30)
2014-07-09 17:02:47 -04:00
2015-07-28 21:57:39 -04:00
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.
2015-10-31 21:22:40 -04:00
### Breaking Changes
2014-10-08 00:17:46 -04:00
2015-07-12 22:31:59 -04:00
- Using a Rails initializer to reopen PaperTrail::Version or otherwise extend
PaperTrail is no longer recommended. An alternative is described in the
2018-05-09 07:25:56 -04:00
readme. See https://github.com/paper-trail-gem/paper_trail/pull/557 and
https://github.com/paper-trail-gem/paper_trail/pull/492.
2015-07-12 22:39:04 -04:00
- If you depend on the `RSpec` or `Cucumber` helpers, you must
2018-05-09 07:25:56 -04:00
[require them in your test helper ](https://github.com/paper-trail-gem/paper_trail#testing ).
- [#566 ](https://github.com/paper-trail-gem/paper_trail/pull/566 ) - Removed deprecated
2015-08-03 16:02:10 -04:00
methods `paper_trail_on` and `paper_trail_off` . Use `paper_trail_on!` and
`paper_trail_off!` instead.
2018-05-09 07:25:56 -04:00
- [#458 ](https://github.com/paper-trail-gem/paper_trail/pull/458 ) - Version metadata
2015-07-28 21:57:39 -04:00
(the `:meta` option) from AR attributes for `create` events will now save the
current value instead of `nil` .
2018-05-09 07:25:56 -04:00
- [#391 ](https://github.com/paper-trail-gem/paper_trail/issues/391 ) - `object_changes`
2015-07-28 21:57:39 -04:00
value should dump to `YAML` as a normal `Hash` instead of an
`ActiveSupport::HashWithIndifferentAccess` .
2018-05-09 07:25:56 -04:00
- [#375 ](https://github.com/paper-trail-gem/paper_trail/pull/375 ) /
[#374 ](https://github.com/paper-trail-gem/paper_trail/issues/374 ) /
[#354 ](https://github.com/paper-trail-gem/paper_trail/issues/354 ) /
[#131 ](https://github.com/paper-trail-gem/paper_trail/issues/131 ) -
2015-07-28 21:57:39 -04:00
Versions are now saved with an `after_` callback, instead of a `before_`
callback. This ensures that the timestamp field for a version matches the
corresponding timestamp in the model.
- `3da1f104` - `PaperTrail.config` and `PaperTrail.configure` are now
identical: both return the `PaperTrail::Config` instance and also
yield it if a block is provided.
2015-06-27 22:47:05 -04:00
2015-07-12 22:40:52 -04:00
### Added
2015-01-04 21:14:54 -05:00
2018-05-09 07:25:56 -04:00
- [#525 ](https://github.com/paper-trail-gem/paper_trail/issues/525 ) /
[#512 ](https://github.com/paper-trail-gem/paper_trail/pull/512 ) -
2015-07-28 21:57:39 -04:00
Support for virtual accessors and redefined setter and getter methods.
2018-05-09 07:25:56 -04:00
- [#518 ](https://github.com/paper-trail-gem/paper_trail/pull/518 ) - Support for
2015-07-28 21:57:39 -04:00
querying against PostgreSQL's
[`JSON` and `JSONB` column types ](http://www.postgresql.org/docs/9.4/static/datatype-json.html )
via `PaperTrail::VersionConcern#where_object` and
`PaperTrail::VersionConcern#where_object_changes`
2018-05-09 07:25:56 -04:00
- [#507 ](https://github.com/paper-trail-gem/paper_trail/pull/507 ) -
2015-07-28 21:57:39 -04:00
New option: `:save_changes` controls whether or not to save changes to the
`object_changes` column (if it exists).
2018-05-09 07:25:56 -04:00
- [#500 ](https://github.com/paper-trail-gem/paper_trail/pull/500 ) - Support for
2015-07-28 21:57:39 -04:00
passing an empty array to the `on` option (`on: []`) to disable all
automatic versioning.
2018-05-09 07:25:56 -04:00
- [#494 ](https://github.com/paper-trail-gem/paper_trail/issues/494 ) - The install
2015-07-28 21:57:39 -04:00
generator will warn the user if the migration they are attempting to
generate already exists.
2018-05-09 07:25:56 -04:00
- [#484 ](https://github.com/paper-trail-gem/paper_trail/pull/484 ) - Support for
2015-07-28 21:57:39 -04:00
[PostgreSQL's `JSONB` Type ](http://www.postgresql.org/docs/9.4/static/datatype-json.html )
for storing `object` and `object_changes` .
2018-05-09 07:25:56 -04:00
- [#439 ](https://github.com/paper-trail-gem/paper_trail/pull/439 ) /
[#12 ](https://github.com/paper-trail-gem/paper_trail/issues/12 ) -
2015-07-28 21:57:39 -04:00
Support for versioning associations (has many, has one, etc.) one level deep.
2018-05-09 07:25:56 -04:00
- [#420 ](https://github.com/paper-trail-gem/paper_trail/issues/420 ) - Add
2015-07-28 21:57:39 -04:00
`VersionConcern#where_object_changes` instance method; acts as a helper for
querying against the `object_changes` column in versions table.
2018-05-09 07:25:56 -04:00
- [#416 ](https://github.com/paper-trail-gem/paper_trail/issues/416 ) - Added a
2015-07-28 21:57:39 -04:00
`config` option for enabling/disabling utilization of
`serialized_attributes` for `ActiveRecord` , necessary because
`serialized_attributes` has been deprecated in `ActiveRecord` version `4.2`
and will be removed in version `5.0`
2018-05-09 07:25:56 -04:00
- [#399 ](https://github.com/paper-trail-gem/paper_trail/pull/399 ) - Add `:dup`
2015-07-28 21:57:39 -04:00
argument for options hash to `reify` which forces a new model instance.
2018-05-09 07:25:56 -04:00
- [#394 ](https://github.com/paper-trail-gem/paper_trail/pull/394 ) - Add RSpec matcher
2015-07-28 21:57:39 -04:00
`have_a_version_with` for easier testing.
2018-05-09 07:25:56 -04:00
- [#347 ](https://github.com/paper-trail-gem/paper_trail/pull/347 ) - Autoload
2015-07-28 21:57:39 -04:00
`ActiveRecord` models in via a `Rails::Engine` when the gem is used with
`Rails` .
2014-07-09 17:02:47 -04:00
2015-07-12 22:40:52 -04:00
### Fixed
2018-05-09 07:25:56 -04:00
- [#563 ](https://github.com/paper-trail-gem/paper_trail/pull/563 ) - Fixed a bug in
2015-07-28 21:57:39 -04:00
`touch_with_version` so that it will still create a version even when the
`on` option is, e.g. `[:create]` .
2018-05-09 07:25:56 -04:00
- [#541 ](https://github.com/paper-trail-gem/paper_trail/pull/541 ) -
2015-07-28 21:57:39 -04:00
`PaperTrail.config.enabled` should be Thread Safe
2018-05-09 07:25:56 -04:00
- [#451 ](https://github.com/paper-trail-gem/paper_trail/issues/451 ) - Fix `reify`
2015-07-28 21:57:39 -04:00
method in context of model where the base class has a default scope, and the
live instance is not scoped within that default scope.
2018-05-09 07:25:56 -04:00
- [#440 ](https://github.com/paper-trail-gem/paper_trail/pull/440 ) - `versions`
2015-07-28 21:57:39 -04:00
association should clear/reload after a transaction rollback.
2018-05-09 07:25:56 -04:00
- [#438 ](https://github.com/paper-trail-gem/paper_trail/issues/438 ) -
2015-07-28 21:57:39 -04:00
`ModelKlass.paper_trail_enabled_for_model?` should return `false` if
`has_paper_trail` has not been declared on the class.
2018-05-09 07:25:56 -04:00
- [#404 ](https://github.com/paper-trail-gem/paper_trail/issues/404 ) /
[#428 ](https://github.com/paper-trail-gem/paper_trail/issues/428 ) -
2015-07-28 21:57:39 -04:00
`model_instance.dup` does 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 the `dup` behavior. Also fixes errors occuring when
a user attempts to update the inheritance column on an STI model instance in
`ActiveRecord` 4.1.x
2018-05-09 07:25:56 -04:00
- [#427 ](https://github.com/paper-trail-gem/paper_trail/pull/427 ) - Fix `reify`
2015-07-28 21:57:39 -04:00
method in context of model where a column has been removed.
2018-05-09 07:25:56 -04:00
- [#414 ](https://github.com/paper-trail-gem/paper_trail/issues/414 ) - Fix
2015-07-28 21:57:39 -04:00
functionality `ignore` argument to `has_paper_trail` in `ActiveRecord` 4.
2018-05-09 07:25:56 -04:00
- [#413 ](https://github.com/paper-trail-gem/paper_trail/issues/413 ) - Utilize
2015-07-28 21:57:39 -04:00
[RequestStore ](https://github.com/steveklabnik/request_store ) to ensure that
the `PaperTrail.whodunnit` is set in a thread safe manner within Rails and
Sinatra.
2018-05-09 07:25:56 -04:00
- [#381 ](https://github.com/paper-trail-gem/paper_trail/issues/381 ) - Fix `irb`
2015-07-28 21:57:39 -04:00
warning: `can't alias context from irb_context` . `Rspec` and `Cucumber`
helpers should not be loaded by default, regardless of whether those
libraries are loaded.
2018-05-09 07:25:56 -04:00
- [#248 ](https://github.com/paper-trail-gem/paper_trail/issues/248 ) - In MySQL, to
2015-07-28 21:57:39 -04:00
prevent truncation, generated migrations now use `longtext` instead of `text` .
- Methods handling serialized attributes should fallback to the currently set
Serializer instead of always falling back to `PaperTrail::Serializers::YAML` .
### Deprecated
2018-05-09 07:25:56 -04:00
- [#479 ](https://github.com/paper-trail-gem/paper_trail/issues/479 ) - Deprecated
2015-07-28 21:57:39 -04:00
`originator` method, use `paper_trail_originator` .
2015-07-12 22:40:52 -04:00
2015-12-13 22:14:25 -05:00
## 3.0.9
2018-05-09 07:25:56 -04:00
- [#479 ](https://github.com/paper-trail-gem/paper_trail/issues/479 ) - Deprecated
2015-12-13 22:14:25 -05:00
`originator` method in favor of `paper_trail_originator` Deprecation warning
informs users that the `originator` of the methods will be removed in
version `4.0` . (Backported from v4)
- Updated deprecation warnings for `Model.paper_trail_on` and
`Model.paper_trail_off` to have display correct version number the methods
will be removed (`4.0`)
2015-04-29 17:10:37 -04:00
## 3.0.8
2018-05-09 07:25:56 -04:00
- [#525 ](https://github.com/paper-trail-gem/paper_trail/issues/525 ) / [#512 ](https://github.com/paper-trail-gem/paper_trail/pull/512 ) -
2015-04-29 17:10:37 -04:00
Support for virtual accessors and redefined setter and getter methods.
2015-03-02 13:11:19 -05:00
## 3.0.7
2018-05-09 07:25:56 -04:00
- [#404 ](https://github.com/paper-trail-gem/paper_trail/issues/404 ) / [#428 ](https://github.com/paper-trail-gem/paper_trail/issues/428 ) -
2015-03-02 13:11:19 -05:00
Fix errors occuring when a user attempts to update the inheritance column on an STI model instance in `ActiveRecord` 4.1.x
2014-10-09 12:42:31 -04:00
## 3.0.6
2018-05-09 07:25:56 -04:00
- [#414 ](https://github.com/paper-trail-gem/paper_trail/issues/414 ) - Backport fix for `ignore` argument to `has_paper_trail` in
2014-10-09 12:42:31 -04:00
`ActiveRecord` 4.
2014-08-29 19:16:07 -04:00
## 3.0.5
2014-08-29 18:43:52 -04:00
2018-05-09 07:25:56 -04:00
- [#401 ](https://github.com/paper-trail-gem/paper_trail/issues/401 ) / [#406 ](https://github.com/paper-trail-gem/paper_trail/issues/406 ) -
2016-10-09 21:49:10 -04:00
`PaperTrail::Version` class is not loaded via a `Rails::Engine` , even when the gem is used within Rails. This feature has
2014-12-29 15:03:40 -05:00
will be re-introduced in version `4.0` .
2018-05-09 07:25:56 -04:00
- [#398 ](https://github.com/paper-trail-gem/paper_trail/pull/398 ) - Only require the `RSpec` helper if `RSpec::Core` is required.
2014-08-29 18:43:52 -04:00
2014-06-27 11:58:57 -04:00
## 3.0.3
2014-09-02 14:08:43 -04:00
*This version was yanked from RubyGems and has been replaced by version `3.0.5` , which is almost identical, but does not eager load
2014-08-29 18:43:52 -04:00
in the `PaperTrail::Version` class through a `Rails::Engine` when the gem is used on Rails since it was causing issues for some users.*
2014-05-28 19:18:53 -04:00
2018-05-09 07:25:56 -04:00
- [#386 ](https://github.com/paper-trail-gem/paper_trail/issues/386 ) - Fix eager loading of `versions` association with custom class name
2014-06-24 12:42:26 -04:00
in `ActiveRecord` 4.1.
2018-05-09 07:25:56 -04:00
- [#384 ](https://github.com/paper-trail-gem/paper_trail/issues/384 ) - Fix `VersionConcern#originator` instance method.
- [#383 ](https://github.com/paper-trail-gem/paper_trail/pull/383 ) - Make gem compatible with `ActiveRecord::Enum` (available in `ActiveRecord` 4.1+).
- [#380 ](https://github.com/paper-trail-gem/paper_trail/pull/380 ) / [#377 ](https://github.com/paper-trail-gem/paper_trail/issues/377 ) -
2014-06-27 11:10:45 -04:00
Add `VersionConcern#where_object` instance method; acts as a helper for querying against the `object` column in versions table.
2018-05-09 07:25:56 -04:00
- [#373 ](https://github.com/paper-trail-gem/paper_trail/pull/373 ) - Fix default sort order for the `versions` association in `ActiveRecord` 4.1.
- [#372 ](https://github.com/paper-trail-gem/paper_trail/pull/372 ) - Use [Arel ](https://github.com/rails/arel ) for SQL construction.
- [#365 ](https://github.com/paper-trail-gem/paper_trail/issues/365 ) - `VersionConcern#version_at` should return `nil` when receiving a timestamp
2014-06-18 11:01:38 -04:00
that occured after the object was destroyed.
2014-06-11 14:55:04 -04:00
- Expand `PaperTrail::VERSION` into a module, mimicking the form used by Rails to give it some additional modularity & versatility.
2014-05-29 10:34:25 -04:00
- Fixed `VersionConcern#index` instance method so that it conforms to using the primary key for ordering when possible.
2014-05-28 19:18:53 -04:00
2014-05-12 10:48:16 -04:00
## 3.0.2
2014-03-18 16:34:25 -04:00
2018-05-09 07:25:56 -04:00
- [#357 ](https://github.com/paper-trail-gem/paper_trail/issues/357 ) - If a `Version` instance is reified and then persisted at that state,
2014-04-16 16:33:10 -04:00
it's timestamp attributes for update should still get `touch` ed.
2018-05-09 07:25:56 -04:00
- [#351 ](https://github.com/paper-trail-gem/paper_trail/pull/351 ) / [#352 ](https://github.com/paper-trail-gem/paper_trail/pull/352 ) -
2014-04-02 17:05:20 -04:00
`PaperTrail::Rails::Controller` should hook into all controller types, and should not get loaded unless `ActionController` is.
2018-05-09 07:25:56 -04:00
- [#346 ](https://github.com/paper-trail-gem/paper_trail/pull/346 ) - `user_for_paper_trail` method should accommodate different types
2014-03-20 16:04:53 -04:00
for return values from `current_user` method.
2018-05-09 07:25:56 -04:00
- [#344 ](https://github.com/paper-trail-gem/paper_trail/pull/344 ) - Gem is now tested against `MySQL` and `PostgreSQL` in addition to `SQLite` .
- [#317 ](https://github.com/paper-trail-gem/paper_trail/issues/317 ) / [#314 ](https://github.com/paper-trail-gem/paper_trail/issues/314 ) -
2014-05-09 12:08:02 -04:00
`versions` should default to ordering via the primary key if it is an integer to avoid timestamp comparison issues.
2014-03-18 16:34:25 -04:00
- `PaperTrail::Cleaner.clean_versions!` should group versions by `PaperTrail.timestamp_field` when deciding which ones to
keep / destroy, instead of always grouping by the `created_at` field.
2014-04-16 16:33:10 -04:00
- If a `Version` instance is reified and then persisted at that state, it's source version
2014-04-16 12:44:21 -04:00
(`model_instance#version_association_name`, usually `model_instance#version` ) will get cleared since persisting it causes it to
become the live instance.
2014-04-16 12:17:33 -04:00
- If `destroy` actions are tracked for a versioned model, invoking `destroy` on the model will cause the corresponding version that
2014-04-16 12:44:21 -04:00
gets generated to be assigned as the source version (`model_instance#version_association_name`, usually `model_instance#version` ).
2014-03-18 16:34:25 -04:00
2014-03-14 17:52:17 -04:00
## 3.0.1
2014-01-08 15:51:53 -05:00
2018-05-09 07:25:56 -04:00
- [#340 ](https://github.com/paper-trail-gem/paper_trail/issues/340 ) - Prevent potential error encountered when using the `InstallGenerator`
2014-03-07 16:13:32 -05:00
with Rails `4.1.0.rc1` .
2018-05-09 07:25:56 -04:00
- [#334 ](https://github.com/paper-trail-gem/paper_trail/pull/334 ) - Add small-scope `whodunnit` method to `PaperTrail::Model::InstanceMethods` .
- [#329 ](https://github.com/paper-trail-gem/paper_trail/issues/329 ) - Add `touch_with_version` method to `PaperTrail::Model::InstanceMethods` ,
2015-01-15 11:39:48 -05:00
to allow for generating a version while `touch` ing a model.
2018-05-09 07:25:56 -04:00
- [#328 ](https://github.com/paper-trail-gem/paper_trail/pull/328 ) / [#326 ](https://github.com/paper-trail-gem/paper_trail/issues/326 ) /
[#307 ](https://github.com/paper-trail-gem/paper_trail/issues/307 ) - `Model.paper_trail_enabled_for_model?` and
2014-02-20 11:40:52 -05:00
`model_instance.without_versioning` is now thread-safe.
2018-05-09 07:25:56 -04:00
- [#316 ](https://github.com/paper-trail-gem/paper_trail/issues/316 ) - `user_for_paper_trail` should default to `current_user.try(:id)`
2014-02-11 11:08:58 -05:00
instead of `current_user` (if `current_user` is defined).
2018-05-09 07:25:56 -04:00
- [#313 ](https://github.com/paper-trail-gem/paper_trail/pull/313 ) - Make the `Rails::Controller` helper compatible with
2014-01-08 15:51:53 -05:00
`ActionController::API` for compatibility with the [`rails-api` ](https://github.com/rails-api/rails-api ) gem.
2018-05-09 07:25:56 -04:00
- [#312 ](https://github.com/paper-trail-gem/paper_trail/issues/312 ) - Fix RSpec `with_versioning` class level helper method.
2014-03-12 10:09:59 -04:00
- `model_instance.without_versioning` now yields the `model_instance` , enabling syntax like this:
`model_instance.without_versioning { |obj| obj.update_attributes(:name => 'value') }` .
2014-12-29 15:03:40 -05:00
- Deprecated `Model.paper_trail_on` and `Model.paper_trail_off` in favor of bang versions of the methods.
Deprecation warning informs users that the non-bang versions of the methods will be removed in version `4.0`
2014-01-08 15:51:53 -05:00
2013-12-11 17:45:50 -05:00
## 3.0.0
2013-06-18 14:54:24 -04:00
2018-05-09 07:25:56 -04:00
- [#305 ](https://github.com/paper-trail-gem/paper_trail/pull/305 ) - `PaperTrail::VERSION` should be loaded at runtime.
- [#295 ](https://github.com/paper-trail-gem/paper_trail/issues/295 ) - Explicitly specify table name for version class when
2013-11-15 13:54:30 -05:00
querying attributes. Prevents `AmbiguousColumn` errors on certain `JOIN` statements.
2018-05-09 07:25:56 -04:00
- [#289 ](https://github.com/paper-trail-gem/paper_trail/pull/289 ) - Use `ActiveSupport::Concern` for implementation of base functionality on
2013-10-29 11:57:41 -04:00
`PaperTrail::Version` class. Increases flexibility and makes it easier to use custom version classes with multiple `ActiveRecord` connections.
2018-05-09 07:25:56 -04:00
- [#288 ](https://github.com/paper-trail-gem/paper_trail/issues/288 ) - Change all scope declarations to class methods on the `PaperTrail::Version`
2013-10-17 14:46:06 -04:00
class. Fixes usability when `PaperTrail::Version.abstract_class? == true` .
2018-05-09 07:25:56 -04:00
- [#287 ](https://github.com/paper-trail-gem/paper_trail/issues/287 ) - Support for
2013-10-16 15:28:16 -04:00
[PostgreSQL's JSON Type ](http://www.postgresql.org/docs/9.2/static/datatype-json.html ) for storing `object` and `object_changes` .
2018-05-09 07:25:56 -04:00
- [#281 ](https://github.com/paper-trail-gem/paper_trail/issues/281 ) - `Rails::Controller` helper will return `false` for the
2013-10-10 17:46:42 -04:00
`paper_trail_enabled_for_controller` method if `PaperTrail.enabled? == false` .
2018-05-09 07:25:56 -04:00
- [#280 ](https://github.com/paper-trail-gem/paper_trail/pull/280 ) - Don't track virtual timestamp attributes.
- [#278 ](https://github.com/paper-trail-gem/paper_trail/issues/278 ) / [#272 ](https://github.com/paper-trail-gem/paper_trail/issues/272 ) -
2013-10-02 13:48:20 -04:00
Make RSpec and Cucumber helpers usable with [Spork ](https://github.com/sporkrb/spork ) and [Zeus ](https://github.com/burke/zeus ).
2018-05-09 07:25:56 -04:00
- [#273 ](https://github.com/paper-trail-gem/paper_trail/pull/273 ) - Make the `only` and `ignore` options accept `Hash` arguments;
2013-09-19 16:18:02 -04:00
allows for conditional tracking.
2018-05-09 07:25:56 -04:00
- [#264 ](https://github.com/paper-trail-gem/paper_trail/pull/264 ) - Allow unwrapped symbol to be passed in to the `on` option.
- [#224 ](https://github.com/paper-trail-gem/paper_trail/issues/224 )/[#236](https://github.com/paper-trail-gem/paper_trail/pull/236) -
2013-07-02 11:38:23 -04:00
Fixed compatibility with [ActsAsTaggableOn ](https://github.com/mbleigh/acts-as-taggable-on ).
2018-05-09 07:25:56 -04:00
- [#235 ](https://github.com/paper-trail-gem/paper_trail/pull/235 ) - Dropped unnecessary secondary sort on `versions` association.
- [#216 ](https://github.com/paper-trail-gem/paper_trail/pull/216 ) - Added helper & extension for [RSpec ](https://github.com/rspec/rspec ),
2013-08-28 10:29:25 -04:00
and helper for [Cucumber ](http://cukes.info ).
2018-05-09 07:25:56 -04:00
- [#212 ](https://github.com/paper-trail-gem/paper_trail/pull/212 ) - Added `PaperTrail::Cleaner` module, useful for discarding draft versions.
- [#207 ](https://github.com/paper-trail-gem/paper_trail/issues/207 ) - Versions for `'create'` events are now created with `create!` instead of
2013-08-08 16:23:02 -04:00
`create` so that an exception gets raised if it is appropriate to do so.
2018-05-09 07:25:56 -04:00
- [#199 ](https://github.com/paper-trail-gem/paper_trail/pull/199 ) - Rails 4 compatibility.
- [#165 ](https://github.com/paper-trail-gem/paper_trail/pull/165 ) - Namespaced the `Version` class under the `PaperTrail` module.
- [#119 ](https://github.com/paper-trail-gem/paper_trail/issues/119 ) - Support for [Sinatra ](http://www.sinatrarb.com/ ); decoupled gem from `Rails` .
2013-10-17 22:05:24 -04:00
- Renamed the default serializers from `PaperTrail::Serializers::Yaml` and `PaperTrail::Serializers::Json` to the capitalized forms,
`PaperTrail::Serializers::YAML` and `PaperTrail::Serializers::JSON` .
2013-12-02 11:18:43 -05:00
- Removed deprecated `set_whodunnit` method from Rails Controller scope.
2013-06-18 14:54:24 -04:00
2013-05-23 16:09:46 -04:00
## 2.7.2
2013-03-26 12:34:38 -04:00
2018-05-09 07:25:56 -04:00
- [#228 ](https://github.com/paper-trail-gem/paper_trail/issues/228 ) - Refactored default `user_for_paper_trail` method implementation
2014-02-20 11:40:52 -05:00
so that `current_user` only gets invoked if it is defined.
2018-05-09 07:25:56 -04:00
- [#219 ](https://github.com/paper-trail-gem/paper_trail/pull/219 ) - Fixed issue where attributes stored with `nil` value might not get
2014-02-20 11:40:52 -05:00
reified properly depending on the way the serializer worked.
2018-05-09 07:25:56 -04:00
- [#213 ](https://github.com/paper-trail-gem/paper_trail/issues/213 ) - Added a `version_limit` option to the `PaperTrail::Config` options
2014-02-20 11:40:52 -05:00
that can be used to restrict the number of versions PaperTrail will store per object instance.
2018-05-09 07:25:56 -04:00
- [#187 ](https://github.com/paper-trail-gem/paper_trail/pull/187 ) - Confirmed JRuby support.
- [#174 ](https://github.com/paper-trail-gem/paper_trail/pull/174 ) - The `event` field on the versions table can now be customized.
2013-03-26 12:34:38 -04:00
2013-02-15 13:06:20 -05:00
## 2.7.1
2012-12-28 14:06:34 -05:00
2018-05-09 07:25:56 -04:00
- [#206 ](https://github.com/paper-trail-gem/paper_trail/issues/206 ) - Fixed Ruby 1.8.7 compatibility for tracking `object_changes` .
- [#200 ](https://github.com/paper-trail-gem/paper_trail/issues/200 ) - Fixed `next_version` method so that it returns the live model
2013-02-05 13:45:59 -05:00
when called on latest reified version of a model prior to the live model.
2018-05-09 07:25:56 -04:00
- [#197 ](https://github.com/paper-trail-gem/paper_trail/issues/197 ) - PaperTrail now falls back on using YAML for serialization of
2013-02-04 16:00:34 -05:00
serialized model attributes for storage in the `object` and `object_changes` columns in the `Version` table. This fixes
compatibility for `Rails 3.0.x` for projects that employ the `serialize` declaration on a model.
2018-05-09 07:25:56 -04:00
- [#194 ](https://github.com/paper-trail-gem/paper_trail/issues/194 ) - A JSON serializer is now included in the gem.
- [#192 ](https://github.com/paper-trail-gem/paper_trail/pull/192 ) - `object_changes` should store serialized representation of serialized
2013-01-21 11:08:31 -05:00
attributes for `create` actions (in addition to `update` actions, which had already been patched by
2018-05-09 07:25:56 -04:00
[#180 ](https://github.com/paper-trail-gem/paper_trail/pull/180 )).
- [#190 ](https://github.com/paper-trail-gem/paper_trail/pull/190 ) - Fixed compatibility with
2013-01-21 11:01:09 -05:00
[SerializedAttributes ](https://github.com/technoweenie/serialized_attributes ) gem.
2018-05-09 07:25:56 -04:00
- [#189 ](https://github.com/paper-trail-gem/paper_trail/pull/189 ) - Provided support for a `configure` block initializer.
2013-01-04 10:19:19 -05:00
- Added `setter` method for the `serializer` config option.
2012-12-28 01:19:29 -05:00
## 2.7.0
2012-11-28 11:18:42 -05:00
2018-05-09 07:25:56 -04:00
- [#183 ](https://github.com/paper-trail-gem/paper_trail/pull/183 ) - Fully qualify the `Version` class to help prevent
2012-11-28 11:18:42 -05:00
namespace resolution errors within other gems / plugins.
2018-05-09 07:25:56 -04:00
- [#180 ](https://github.com/paper-trail-gem/paper_trail/pull/180 ) - Store serialized representation of serialized attributes
2013-02-04 16:00:34 -05:00
on the `object` and `object_changes` columns in the `Version` table.
2018-05-09 07:25:56 -04:00
- [#164 ](https://github.com/paper-trail-gem/paper_trail/pull/164 ) - Allow usage of custom serializer for storage of object attributes.
2012-11-28 11:18:42 -05:00
2012-11-16 12:24:46 -05:00
## 2.6.4
2012-10-16 20:20:44 -04:00
2018-05-09 07:25:56 -04:00
- [#181 ](https://github.com/paper-trail-gem/paper_trail/issues/181 )/[#182](https://github.com/paper-trail-gem/paper_trail/pull/182) -
2012-11-16 11:54:47 -05:00
Controller metadata methods should only be evaluated when `paper_trail_enabled_for_controller == true` .
2018-05-09 07:25:56 -04:00
- [#177 ](https://github.com/paper-trail-gem/paper_trail/issues/177 )/[#178](https://github.com/paper-trail-gem/paper_trail/pull/178) -
2012-10-30 15:20:47 -04:00
Factored out `version_key` into it's own method to prevent `ConnectionNotEstablished` error from getting thrown in
instances where `has_paper_trail` is declared on class prior to ActiveRecord establishing a connection.
2018-05-09 07:25:56 -04:00
- [#176 ](https://github.com/paper-trail-gem/paper_trail/pull/176 ) - Force metadata calls for attributes to use current value
2012-10-16 20:20:44 -04:00
if attribute value is changing.
2018-05-09 07:25:56 -04:00
- [#173 ](https://github.com/paper-trail-gem/paper_trail/pull/173 ) - Update link to [diff-lcs ](https://github.com/halostatue/diff-lcs ).
- [#172 ](https://github.com/paper-trail-gem/paper_trail/pull/172 ) - Save `object_changes` on creation.
- [#168 ](https://github.com/paper-trail-gem/paper_trail/pull/168 ) - Respect conditional `:if` or `:unless` arguments to the
2012-11-06 11:34:02 -05:00
`has_paper_trail` method for `destroy` events.
2018-05-09 07:25:56 -04:00
- [#167 ](https://github.com/paper-trail-gem/paper_trail/pull/167 ) - Fix `originator` method so that it works with subclasses and STI.
- [#160 ](https://github.com/paper-trail-gem/paper_trail/pull/160 ) - Fixed failing tests and resolved out of date dependency issues.
- [#157 ](https://github.com/paper-trail-gem/paper_trail/pull/157 ) - Refactored `class_attribute` names on the `ClassMethods` module
2012-11-16 12:24:46 -05:00
for names that are not obviously pertaining to PaperTrail to prevent method name collision.