kevintyll
16a3f93ce9
Include adapter in cache key
...
Confirm caching attributes with different key json_api vs. attributes adapter
Adapted from @kevintyll's original test
https://github.com/rails-api/active_model_serializers/pull/1644#issuecomment-204147094
2016-04-01 00:52:28 -05:00
Benjamin Fleischer
4ba4c298ec
Prefer object.cache_key when available.
2016-03-31 22:29:13 -05:00
kevintyll
ab6bd600e3
When caching, return the object's cache_key up front if it's defined.
...
This will prevent objects PORO objects that don't have updated_at defined, from throwing an error.
Not as big a deal now that PORO objects can inherit ActiveModelSerializers::Model, but still necessary if it's not inherited for whatever reason.
Add the Adapter type to the cache key.
This prevents incorrect results when the same object is serialized with different adapters.
BF:
Cherry-pick of
040a97b9e9
which was a squash of
f89ed71058
from pr 1346
2016-03-31 22:29:13 -05:00
Benjamin Fleischer
d50d29b601
Cleaning up Caching Tests
2016-03-30 09:53:21 -05:00
Yohan Robert
21cb896802
Move SerializableResource to ActiveModelSerializers namespace
...
Ref. https://github.com/rails-api/active_model_serializers/pull/1310
2016-03-30 11:33:04 +02:00
Benjamin Fleischer
355e0f6a37
Merge branch 'lserman-master'
...
Followup needed:
- Update code comments https://github.com/rails-api/active_model_serializers/pull/1622#discussion_r57750471
- Move test class into test scope https://github.com/rails-api/active_model_serializers/pull/1622#discussion_r57659150
2016-03-29 21:50:27 -05:00
Logan Serman
d0389ca765
Fix fragment caching inherited serializers to use distinct per-serializer caches.
2016-03-28 16:26:51 -05:00
Benjamin Fleischer
c3c69a607a
Separate enabling of caching and setting the cache store
2016-03-24 22:20:42 -05:00
Benjamin Fleischer
eda8ff1737
Move serializer caching from adapter
2016-03-13 19:57:59 -05:00