- Introduces a uniform error class, UnsupportedColumnType
- Simplifies the built-in serializers (paper_trail/serializers)
Since 9.2.0, when `object_changes_adapter` was introduced, if someone must use a
text column, and still wants to use these queries, they must write an
`object_changes_adapter`. AFAIK, no one has ever done this. The only public
adapter I know of, paper_trail-hashdiff, only supports json/b columns.
It's also theoretically possible that, after `where_object_changes` dropped
support for text columns, someone wrote a custom serializer (see
`PaperTrail.serializer=`). AFAIK, no one has done that either. Such a technique
was never documented under [6.b. Custom
Serializer](https://github.com/paper-trail-gem/paper_trail#6b-custom-serializer)
This adds in a new query method `where_attribute_changes` which will
look for any versions where there was a change to the attribute
specified.
In instances where you need to look for any changes to a particular
attribute, but don't yet know, or don't care, what the value of the
attribute was that changed at all, this is intended to answer that
question.
Co-authored-by: Jared Beck <jared@jaredbeck.com>
This extends to the public API to provide more targeted
querying of object changes. `where_object_changes` will look for either
side of the change of the attributes provided - either versions where
the attribute changed __from__ the provided value, or changed __to__ the
provided value.
The `where_object_changes_to` addition focuses only on one
side of that equation. If you want to find versions where the
attribute(s) explicitly changed *to* some known value, this will only
show those changes, as opposed to both *from* and *to*.
* Add rails-controller-testing
In order to get all of the tests to pass, this adds in and configures
rails-controller-testing so that `assigns`is available in controller and
integration tests.
* Query Versions Where Object Changed From Attributes
This proposes an extension to the public API to provide more targeted
querying of object changes. `where_object_changes` will look for either
side of the change of the attributes provided - either versions where
the attribute changed __from__ the provided value, or changed __to__ the
provided value.
The proposed `where_object_changes_from` addition focuses only on one
side of that equation. If you want to find versions where the
attribute(s) explicitly changed *from* some known value, this will only
show those changes, as opposed to both *from* and *to*.
* Custom Serializer where_object_changes_from implementation
This mirrors the implementation of WhereObjectChanges#text in
WhereObjectChangesFrom#text in the case of a custom serializer. The
provided YAML serializer does not support this method.
* Document New API Method for Custom Adapter
This provides awareness of the new method that custom object changes
adapters may need to implement to support this change.
* remove rails-controller-testing