mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
close #416; Update CHANGELOG and README w/ instructions on how to use the new config option for SerializedAttribute support
This commit is contained in:
parent
b30b2e86d5
commit
3a17367845
2 changed files with 21 additions and 2 deletions
|
@ -11,10 +11,12 @@ PaperTrail::Rails::Engine.eager_load!
|
|||
- [#438](https://github.com/airblade/paper_trail/issues/438) - `Model.paper_trail_enabled_for_model?` should return `false` if
|
||||
`has_paper_trail` has not been declared on the class.
|
||||
- [#427](https://github.com/airblade/paper_trail/pull/427) - Fix `reify` method in context of model where a column has been removed.
|
||||
- [#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`
|
||||
- [#414](https://github.com/airblade/paper_trail/issues/414) - Fix functionality `ignore` argument to `has_paper_trail`
|
||||
in `ActiveRecord` 4.
|
||||
- [#399](https://github.com/airblade/paper_trail/pull/399) - Add `:dup` argument for options hash to `reify` which forces a
|
||||
new model instance.
|
||||
- [#399](https://github.com/airblade/paper_trail/pull/399) - Add `:dup` argument for options hash to `reify` which forces a new model instance.
|
||||
- [#394](https://github.com/airblade/paper_trail/pull/394) - Add RSpec matcher `have_a_version_with` for easier testing.
|
||||
- [#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`.
|
||||
|
|
17
README.md
17
README.md
|
@ -943,6 +943,23 @@ A valid serializer is a `module` (or `class`) that defines a `load` and `dump` m
|
|||
* [PaperTrail::Serializers::YAML](https://github.com/airblade/paper_trail/blob/master/lib/paper_trail/serializers/yaml.rb) - Default
|
||||
* [PaperTrail::Serializers::JSON](https://github.com/airblade/paper_trail/blob/master/lib/paper_trail/serializers/json.rb)
|
||||
|
||||
## SerializedAttributes support
|
||||
|
||||
PaperTrail has a config option that can be used to enable/disable whether PaperTrail attempts to utilize
|
||||
`ActiveRecord`'s `serialized_attributes` feature. Note: This is enabled by default when PaperTrail is used
|
||||
with `ActiveRecord` version < `4.2`, and disabled by default when used with ActiveRecord `4.2.x`. Since
|
||||
`serialized_attributes` will be removed in `ActiveRecord` version `5.0`, this configuration value
|
||||
has no functionality when PaperTrail is used with version `5.0` or greater.
|
||||
|
||||
```ruby
|
||||
# Enable support
|
||||
>> PaperTrail.config.serialized_attributes = true
|
||||
# Disable support
|
||||
>> PaperTrail.config.serialzied_attributes = false
|
||||
# Get current setting
|
||||
>> PaperTrail.serialized_attributes?
|
||||
```
|
||||
|
||||
## Limiting the number of versions created per object instance
|
||||
|
||||
If you are wary of your `versions` table growing to an unwieldy size, or just don't care to track more than a certain number of versions per object,
|
||||
|
|
Loading…
Reference in a new issue