2014-12-29 20:03:40 +00:00
## 4.0.0 (Unreleased)
2014-07-09 21:02:47 +00:00
2014-09-02 18:08:43 +00:00
##### Breaking change: if you use a custom initializer for PaperTrail in conjunction with Rails, you will need to add this line of code to the beginning of it:
```ruby
PaperTrail::Rails::Engine.eager_load!
```
2014-10-08 04:17:46 +00:00
2015-01-07 21:57:45 +00:00
*Also*
2015-01-05 02:14:54 +00:00
If you depend on the `RSpec` or `Cucumber` helpers, you will need to [manually load them into your test helper ](https://github.com/airblade/paper_trail#testing ).
2015-01-12 16:00:40 +00:00
- [#458 ](https://github.com/airblade/paper_trail/pull/458 ) - For `create` events, metadata pointing at attributes should attempt
to grab the current value instead of looking at the value prior to the change (which would always be `nil` )
2015-01-07 21:57:45 +00:00
- [#440 ](https://github.com/airblade/paper_trail/pull/440 ) - `versions` association should clear/reload after a transaction rollback.
2014-12-22 19:34:35 +00:00
- [#439 ](https://github.com/airblade/paper_trail/pull/439 ) / [#12 ](https://github.com/airblade/paper_trail/issues/12 ) -
Support for versioning of associations (Has Many, Has One, HABTM, etc.)
2015-01-29 22:48:58 +00:00
- [#438 ](https://github.com/airblade/paper_trail/issues/438 ) - `ModelKlass.paper_trail_enabled_for_model?` should return `false` if
2014-10-31 14:40:43 +00:00
`has_paper_trail` has not been declared on the class.
2015-01-29 22:48:58 +00:00
- [#428 ](https://github.com/airblade/paper_trail/issues/428 ) - `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
2014-10-01 20:38:29 +00:00
- [#427 ](https://github.com/airblade/paper_trail/pull/427 ) - Fix `reify` method in context of model where a column has been removed.
2015-01-07 21:57:45 +00:00
- [#420 ](https://github.com/airblade/paper_trail/issues/420 ) - Add `VersionConcern#where_object_changes` instance method;
acts as a helper for querying against the `object_changes` column in versions table.
2014-12-29 19:55:04 +00:00
- [#416 ](https://github.com/airblade/paper_trail/issues/416 ) - Added a `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`
2014-10-09 16:42:31 +00:00
- [#414 ](https://github.com/airblade/paper_trail/issues/414 ) - Fix functionality `ignore` argument to `has_paper_trail`
in `ActiveRecord` 4.
2014-12-29 19:55:04 +00:00
- [#399 ](https://github.com/airblade/paper_trail/pull/399 ) - Add `:dup` argument for options hash to `reify` which forces a new model instance.
2014-07-09 21:02:47 +00:00
- [#394 ](https://github.com/airblade/paper_trail/pull/394 ) - Add RSpec matcher `have_a_version_with` for easier testing.
2014-10-21 19:05:16 +00:00
- [#391 ](https://github.com/airblade/paper_trail/issues/391 ) - `object_changes` value should dump to `YAML` as a normal `Hash`
instead of an `ActiveSupport::HashWithIndifferentAccess` .
2014-12-29 20:42:49 +00:00
- [#381 ](https://github.com/airblade/paper_trail/issues/381 ) - `Rspec` and `Cucumber` helpers should not be loaded by
default, regardless of whether those libraries are loaded.
2014-07-30 20:17:02 +00:00
- [#375 ](https://github.com/airblade/paper_trail/pull/375 ) / [#374 ](https://github.com/airblade/paper_trail/issues/374 ) /
[#354 ](https://github.com/airblade/paper_trail/issues/354 ) / [#131 ](https://github.com/airblade/paper_trail/issues/131 ) -
Versions should be built with `after_` callbacks so the timestamp field for a version can be forced to match the
corresponding timestamp in the database for the state persistence of a change to the base (versioned) model.
2014-10-09 16:42:31 +00:00
- [#347 ](https://github.com/airblade/paper_trail/pull/347 ) - Autoload `ActiveRecord` models in via a `Rails::Engine` when
the gem is used with `Rails` .
2014-09-23 21:31:36 +00:00
- Methods handling serialized attributes should fallback to the currently set Serializer instead of always falling back
to `PaperTrail::Serializers::YAML` .
2014-07-09 21:02:47 +00:00
2014-10-09 16:42:31 +00:00
## 3.0.6
- [#414 ](https://github.com/airblade/paper_trail/issues/414 ) - Backport fix for `ignore` argument to `has_paper_trail` in
`ActiveRecord` 4.
2014-08-29 23:16:07 +00:00
## 3.0.5
2014-08-29 22:43:52 +00:00
- [#401 ](https://github.com/airblade/paper_trail/issues/401 ) / [#406 ](https://github.com/airblade/paper_trail/issues/406 )
`PaperTrail::Version` class is not loaded via a `Rails::Engine` , even when the gem is used with in Rails. This feature has
2014-12-29 20:03:40 +00:00
will be re-introduced in version `4.0` .
2014-09-02 18:08:43 +00:00
- [#398 ](https://github.com/airblade/paper_trail/pull/398 ) - Only require the `RSpec` helper if `RSpec::Core` is required.
2014-08-29 22:43:52 +00:00
2014-06-27 15:58:57 +00:00
## 3.0.3
2014-09-02 18:08:43 +00: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 22:43:52 +00: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 23:18:53 +00:00
2014-06-24 16:42:26 +00:00
- [#386 ](https://github.com/airblade/paper_trail/issues/386 ) - Fix eager loading of `versions` association with custom class name
in `ActiveRecord` 4.1.
2014-06-17 14:58:53 +00:00
- [#384 ](https://github.com/airblade/paper_trail/issues/384 ) - Fix `VersionConcern#originator` instance method.
2014-06-17 15:40:17 +00:00
- [#383 ](https://github.com/airblade/paper_trail/pull/383 ) - Make gem compatible with `ActiveRecord::Enum` (available in `ActiveRecord` 4.1+).
2014-06-27 15:10:45 +00:00
- [#380 ](https://github.com/airblade/paper_trail/pull/380 ) / [#377 ](https://github.com/airblade/paper_trail/issues/377 ) -
Add `VersionConcern#where_object` instance method; acts as a helper for querying against the `object` column in versions table.
2014-06-17 17:04:14 +00:00
- [#373 ](https://github.com/airblade/paper_trail/pull/373 ) - Fix default sort order for the `versions` association in `ActiveRecord` 4.1.
2014-05-28 23:18:53 +00:00
- [#372 ](https://github.com/airblade/paper_trail/pull/372 ) - Use [Arel ](https://github.com/rails/arel ) for SQL construction.
2014-06-18 15:01:38 +00:00
- [#365 ](https://github.com/airblade/paper_trail/issues/365 ) - `VersionConcern#version_at` should return `nil` when receiving a timestamp
that occured after the object was destroyed.
2014-06-11 18:55:04 +00:00
- Expand `PaperTrail::VERSION` into a module, mimicking the form used by Rails to give it some additional modularity & versatility.
2014-05-29 14:34:25 +00:00
- Fixed `VersionConcern#index` instance method so that it conforms to using the primary key for ordering when possible.
2014-05-28 23:18:53 +00:00
2014-05-12 14:48:16 +00:00
## 3.0.2
2014-03-18 20:34:25 +00:00
2014-04-16 20:33:10 +00:00
- [#357 ](https://github.com/airblade/paper_trail/issues/357 ) - If a `Version` instance is reified and then persisted at that state,
it's timestamp attributes for update should still get `touch` ed.
2014-04-02 21:05:20 +00:00
- [#351 ](https://github.com/airblade/paper_trail/pull/351 ) / [#352 ](https://github.com/airblade/paper_trail/pull/352 ) -
`PaperTrail::Rails::Controller` should hook into all controller types, and should not get loaded unless `ActionController` is.
2014-04-16 16:44:21 +00:00
- [#346 ](https://github.com/airblade/paper_trail/pull/346 ) - `user_for_paper_trail` method should accommodate different types
2014-03-20 20:04:53 +00:00
for return values from `current_user` method.
2014-05-09 16:08:02 +00:00
- [#344 ](https://github.com/airblade/paper_trail/pull/344 ) - Gem is now tested against `MySQL` and `PostgreSQL` in addition to `SQLite` .
- [#317 ](https://github.com/airblade/paper_trail/issues/317 ) / [#314 ](https://github.com/airblade/paper_trail/issues/314 ) -
`versions` should default to ordering via the primary key if it is an integer to avoid timestamp comparison issues.
2014-03-18 20:34:25 +00: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 20:33:10 +00:00
- If a `Version` instance is reified and then persisted at that state, it's source version
2014-04-16 16:44:21 +00: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 16:17:33 +00:00
- If `destroy` actions are tracked for a versioned model, invoking `destroy` on the model will cause the corresponding version that
2014-04-16 16:44:21 +00:00
gets generated to be assigned as the source version (`model_instance#version_association_name`, usually `model_instance#version` ).
2014-03-18 20:34:25 +00:00
2014-03-14 21:52:17 +00:00
## 3.0.1
2014-01-08 20:51:53 +00:00
2014-03-07 21:13:32 +00:00
- [#340 ](https://github.com/airblade/paper_trail/issues/340 ) - Prevent potential error encountered when using the `InstallGenerator`
with Rails `4.1.0.rc1` .
2014-03-11 21:55:44 +00:00
- [#334 ](https://github.com/airblade/paper_trail/pull/334 ) - Add small-scope `whodunnit` method to `PaperTrail::Model::InstanceMethods` .
2014-02-21 23:20:40 +00:00
- [#329 ](https://github.com/airblade/paper_trail/issues/329 ) - Add `touch_with_version` method to `PaperTrail::Model::InstanceMethods` ,
2015-01-15 16:39:48 +00:00
to allow for generating a version while `touch` ing a model.
2014-03-11 21:55:44 +00:00
- [#328 ](https://github.com/airblade/paper_trail/pull/328 ) / [#326 ](https://github.com/airblade/paper_trail/issues/326 ) /
2014-02-20 16:40:52 +00:00
[#307 ](https://github.com/airblade/paper_trail/issues/307 ) - `Model.paper_trail_enabled_for_model?` and
`model_instance.without_versioning` is now thread-safe.
2014-02-11 16:08:58 +00:00
- [#316 ](https://github.com/airblade/paper_trail/issues/316 ) - `user_for_paper_trail` should default to `current_user.try(:id)`
instead of `current_user` (if `current_user` is defined).
- [#313 ](https://github.com/airblade/paper_trail/pull/313 ) - Make the `Rails::Controller` helper compatible with
2014-01-08 20:51:53 +00:00
`ActionController::API` for compatibility with the [`rails-api` ](https://github.com/rails-api/rails-api ) gem.
2014-03-11 14:48:06 +00:00
- [#312 ](https://github.com/airblade/paper_trail/issues/312 ) - Fix RSpec `with_versioning` class level helper method.
2014-03-12 14:09:59 +00: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 20:03:40 +00: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 20:51:53 +00:00
2013-12-11 22:45:50 +00:00
## 3.0.0
2013-06-18 18:54:24 +00:00
2013-12-02 15:05:19 +00:00
- [#305 ](https://github.com/airblade/paper_trail/pull/305 ) - `PaperTrail::VERSION` should be loaded at runtime.
2013-11-15 18:54:30 +00:00
- [#295 ](https://github.com/airblade/paper_trail/issues/295 ) - Explicitly specify table name for version class when
querying attributes. Prevents `AmbiguousColumn` errors on certain `JOIN` statements.
2013-10-29 15:57:41 +00:00
- [#289 ](https://github.com/airblade/paper_trail/pull/289 ) - Use `ActiveSupport::Concern` for implementation of base functionality on
`PaperTrail::Version` class. Increases flexibility and makes it easier to use custom version classes with multiple `ActiveRecord` connections.
2013-10-17 18:46:06 +00:00
- [#288 ](https://github.com/airblade/paper_trail/issues/288 ) - Change all scope declarations to class methods on the `PaperTrail::Version`
class. Fixes usability when `PaperTrail::Version.abstract_class? == true` .
2013-10-16 19:28:16 +00:00
- [#287 ](https://github.com/airblade/paper_trail/issues/287 ) - Support for
[PostgreSQL's JSON Type ](http://www.postgresql.org/docs/9.2/static/datatype-json.html ) for storing `object` and `object_changes` .
2013-10-10 21:46:42 +00:00
- [#281 ](https://github.com/airblade/paper_trail/issues/281 ) - `Rails::Controller` helper will return `false` for the
`paper_trail_enabled_for_controller` method if `PaperTrail.enabled? == false` .
2013-10-03 14:43:19 +00:00
- [#280 ](https://github.com/airblade/paper_trail/pull/280 ) - Don't track virtual timestamp attributes.
2014-04-02 21:05:20 +00:00
- [#278 ](https://github.com/airblade/paper_trail/issues/278 ) / [#272 ](https://github.com/airblade/paper_trail/issues/272 ) -
2013-10-02 17:48:20 +00:00
Make RSpec and Cucumber helpers usable with [Spork ](https://github.com/sporkrb/spork ) and [Zeus ](https://github.com/burke/zeus ).
2013-09-19 20:18:02 +00:00
- [#273 ](https://github.com/airblade/paper_trail/pull/273 ) - Make the `only` and `ignore` options accept `Hash` arguments;
allows for conditional tracking.
2013-08-30 19:14:16 +00:00
- [#264 ](https://github.com/airblade/paper_trail/pull/264 ) - Allow unwrapped symbol to be passed in to the `on` option.
2013-07-02 15:38:23 +00:00
- [#224 ](https://github.com/airblade/paper_trail/issues/224 )/[#236](https://github.com/airblade/paper_trail/pull/236) -
Fixed compatibility with [ActsAsTaggableOn ](https://github.com/mbleigh/acts-as-taggable-on ).
2013-06-18 18:54:24 +00:00
- [#235 ](https://github.com/airblade/paper_trail/pull/235 ) - Dropped unnecessary secondary sort on `versions` association.
2013-08-28 14:29:25 +00:00
- [#216 ](https://github.com/airblade/paper_trail/pull/216 ) - Added helper & extension for [RSpec ](https://github.com/rspec/rspec ),
and helper for [Cucumber ](http://cukes.info ).
2013-08-01 19:05:45 +00:00
- [#212 ](https://github.com/airblade/paper_trail/pull/212 ) - Added `PaperTrail::Cleaner` module, useful for discarding draft versions.
2013-08-08 20:23:02 +00:00
- [#207 ](https://github.com/airblade/paper_trail/issues/207 ) - Versions for `'create'` events are now created with `create!` instead of
`create` so that an exception gets raised if it is appropriate to do so.
2013-08-01 00:37:04 +00:00
- [#199 ](https://github.com/airblade/paper_trail/pull/199 ) - Rails 4 compatibility.
2013-08-30 19:14:16 +00:00
- [#165 ](https://github.com/airblade/paper_trail/pull/165 ) - Namespaced the `Version` class under the `PaperTrail` module.
2013-08-13 21:10:41 +00:00
- [#119 ](https://github.com/airblade/paper_trail/issues/119 ) - Support for [Sinatra ](http://www.sinatrarb.com/ ); decoupled gem from `Rails` .
2013-10-18 02:05:24 +00: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 16:18:43 +00:00
- Removed deprecated `set_whodunnit` method from Rails Controller scope.
2013-06-18 18:54:24 +00:00
2013-05-23 20:09:46 +00:00
## 2.7.2
2013-03-26 16:34:38 +00:00
2013-05-22 14:58:42 +00:00
- [#228 ](https://github.com/airblade/paper_trail/issues/228 ) - Refactored default `user_for_paper_trail` method implementation
2014-02-20 16:40:52 +00:00
so that `current_user` only gets invoked if it is defined.
2013-05-13 14:17:19 +00:00
- [#219 ](https://github.com/airblade/paper_trail/pull/219 ) - Fixed issue where attributes stored with `nil` value might not get
2014-02-20 16:40:52 +00:00
reified properly depending on the way the serializer worked.
2013-05-23 19:56:19 +00:00
- [#213 ](https://github.com/airblade/paper_trail/issues/213 ) - Added a `version_limit` option to the `PaperTrail::Config` options
2014-02-20 16:40:52 +00:00
that can be used to restrict the number of versions PaperTrail will store per object instance.
2013-05-13 15:38:53 +00:00
- [#187 ](https://github.com/airblade/paper_trail/pull/187 ) - Confirmed JRuby support.
- [#174 ](https://github.com/airblade/paper_trail/pull/174 ) - The `event` field on the versions table can now be customized.
2013-03-26 16:34:38 +00:00
2013-02-15 18:06:20 +00:00
## 2.7.1
2012-12-28 19:06:34 +00:00
2013-02-11 17:49:08 +00:00
- [#206 ](https://github.com/airblade/paper_trail/issues/206 ) - Fixed Ruby 1.8.7 compatibility for tracking `object_changes` .
2013-02-05 18:45:59 +00:00
- [#200 ](https://github.com/airblade/paper_trail/issues/200 ) - Fixed `next_version` method so that it returns the live model
when called on latest reified version of a model prior to the live model.
2013-02-04 21:00:34 +00:00
- [#197 ](https://github.com/airblade/paper_trail/issues/197 ) - PaperTrail now falls back on using YAML for serialization of
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.
2013-01-22 23:13:58 +00:00
- [#194 ](https://github.com/airblade/paper_trail/issues/194 ) - A JSON serializer is now included in the gem.
2013-01-21 16:08:31 +00:00
- [#192 ](https://github.com/airblade/paper_trail/pull/192 ) - `object_changes` should store serialized representation of serialized
attributes for `create` actions (in addition to `update` actions, which had already been patched by
[#180 ](https://github.com/airblade/paper_trail/pull/180 )).
2013-01-22 23:13:58 +00:00
- [#190 ](https://github.com/airblade/paper_trail/pull/190 ) - Fixed compatibility with
2013-01-21 16:01:09 +00:00
[SerializedAttributes ](https://github.com/technoweenie/serialized_attributes ) gem.
2013-01-21 15:38:43 +00:00
- [#189 ](https://github.com/airblade/paper_trail/pull/189 ) - Provided support for a `configure` block initializer.
2013-01-04 15:19:19 +00:00
- Added `setter` method for the `serializer` config option.
2012-12-28 06:19:29 +00:00
## 2.7.0
2012-11-28 16:18:42 +00:00
- [#183 ](https://github.com/airblade/paper_trail/pull/183 ) - Fully qualify the `Version` class to help prevent
namespace resolution errors within other gems / plugins.
2012-12-28 19:06:34 +00:00
- [#180 ](https://github.com/airblade/paper_trail/pull/180 ) - Store serialized representation of serialized attributes
2013-02-04 21:00:34 +00:00
on the `object` and `object_changes` columns in the `Version` table.
2012-12-28 19:06:34 +00:00
- [#164 ](https://github.com/airblade/paper_trail/pull/164 ) - Allow usage of custom serializer for storage of object attributes.
2012-11-28 16:18:42 +00:00
2012-11-16 17:24:46 +00:00
## 2.6.4
2012-10-17 00:20:44 +00:00
2012-11-16 16:54:47 +00:00
- [#181 ](https://github.com/airblade/paper_trail/issues/181 )/[#182](https://github.com/airblade/paper_trail/pull/182) -
Controller metadata methods should only be evaluated when `paper_trail_enabled_for_controller == true` .
2012-10-30 19:20:47 +00:00
- [#177 ](https://github.com/airblade/paper_trail/issues/177 )/[#178](https://github.com/airblade/paper_trail/pull/178) -
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.
2012-10-17 00:20:44 +00:00
- [#176 ](https://github.com/airblade/paper_trail/pull/176 ) - Force metadata calls for attributes to use current value
if attribute value is changing.
- [#173 ](https://github.com/airblade/paper_trail/pull/173 ) - Update link to [diff-lcs ](https://github.com/halostatue/diff-lcs ).
2012-10-30 19:20:47 +00:00
- [#172 ](https://github.com/airblade/paper_trail/pull/172 ) - Save `object_changes` on creation.
2012-11-06 16:34:02 +00:00
- [#168 ](https://github.com/airblade/paper_trail/pull/168 ) - Respect conditional `:if` or `:unless` arguments to the
`has_paper_trail` method for `destroy` events.
2012-10-17 00:20:44 +00:00
- [#167 ](https://github.com/airblade/paper_trail/pull/167 ) - Fix `originator` method so that it works with subclasses and STI.
2012-11-06 17:19:31 +00:00
- [#160 ](https://github.com/airblade/paper_trail/pull/160 ) - Fixed failing tests and resolved out of date dependency issues.
- [#157 ](https://github.com/airblade/paper_trail/pull/157 ) - Refactored `class_attribute` names on the `ClassMethods` module
2012-11-16 17:24:46 +00:00
for names that are not obviously pertaining to PaperTrail to prevent method name collision.