This change alters the cache namespace prior to retrieving cached record
data to ensure that different fieldsets are given different cache keys.
Previously, all cache keys for the same record would be specified
identically, leading to a situation where the fieldset would be ignored
if record caching is enabled.
Fixes#90.
* chore(tests): add missing test for relationships belongs_to polymorphic type definitions
* chore(tests): add missing test for relationships belongs_to polymorphic type definitions
* linting
* fix(ObjectSerializer): pass to_json arguments
to_json takes arguments that serialized_json did not define. This breaks a lot of things.
* Update CHANGELOG.md with latest fix and release
- Very explicit where caching is stored
- No `Rails.cache` automagic with possible colliding keys
- Rails 5.2+ cache versioning support
- Implicit namespace support (by cache instance, e.g.
ActiveSupport::Cache::MemoryStore.new(namespace: 'jast_jsonapi')
- All cache instance options are supported
* allow the relationship's serializer key to be a Proc
* fixes
* specifically test the relationship name and the resource type
* support object blocks without a serializer defined
* stop validation gracefully if the relationship is polymorphic
* improve performance by using instance variables instead of accessor methods
* force initialization up front to avoid the iterative calls
* serializer procs should act like polymorphic when determining the id_method_name
* specs for serializer procs
* updated with more details and examples for relationship serializer options
* adjust specs to define the serializers
* avoid extra method calls for performance
* name change
* one less function call for better performance
* do not require lazy loaded relationships to resolve the serializer
* give polymorphic precedence for backwards compatibility
* move serializer inference into ObjectSerializer to allow for overriding
* move method for better diff
* fix race condition in multi-threaded environments