Pagination links will be included in your response automatically as long
as the resource is paginated using Kaminari or WillPaginate
and if you are using a JSON-API adapter. The others adapters does not have this feature.
I wonder how `ActiveRecord::Serializer` and `ActiveRecord::Serializers` are different? However I found they have different name between the title and code.
It's an upgrade based on the new Cache implementation #693.
It allows to use the Rails conventions to cache
specific attributes or associations.
It's based on the Cache Composition implementation.
We should probably make it clearer how active the development is and also how quickly we close issues. Will help motivate us to do better and also clarify to everyone else that we are _really_ active.
We discussed this previously, but I think it's time for the mailing list to be removed from the README. Every day more discussion, issues, and pull requests happen here then ever before. The mailing list is not representative of this activity and only dilutes the purpose of the blossoming community we're finding here.
A related note: I think we should actively encourage folks to ask questions on StackOverflow with the AMS tag, and put some documentation in here about that. I can open a separate PR for this later, but it would require more than a few of us to actively monitor SO and help where we can. If we successfully do this, then I think we effectively cover all the use cases the mailing list originally may have had.
It's a new implementation of cache based on ActiveSupport::Cache.
The implementation abstracts the cache in Adapter class on a
private method called cached_object, this method is intended
to be used on Adapters inside serializable_hash method in order
to cache each instance of the object that will be returned by
the serializer.
Some of its features are:
- A different syntax. (no longer need the cache_key method).
- An options argument that have the same arguments of ActiveSupport::Cache::Store, plus a key option that will be the prefix of the object cache on a pattern "#{key}-#{object.id}".
- It cache the objects individually and not the whole Serializer return, re-using it in different requests (as a show and a index method for example.)
Currently, 0.10.0.pre doesn't support `meta` option in `render`. This
way, there's no way to support features such as pagination. `0.9` had
this feature in place.
This adds support for it, as well as fixes small things in README.md.
This won't support `meta` in array responses because arrays don't have
keys, obviously. Also, the response should have a `root` key, otherwise
no `meta` will be included.
In some cases, for example using JsonApi, ArraySerializer will result in
a response with a `root`. In that case, `meta` will be included.
The options passed to the render are partitioned into adapter options
and serializer options. 'include' and 'root' are sent to the adapter,
not sure what options would go directly to serializer, but leaving this
in until I understand that better.