Handle correctly null associations

null belongs_to associations are now serialized as nil instead
of raise an error during serialization.
Merge pull request #708 from ride/fix-for-nil-associations

Handle correctly null associations
Add type when association name is different than objects type
Merge pull request #709 from ride/add-type

Add type key when association name is different than object type
JSON-API: Don't include linked section if associations are empty
Fixes rbx gems bundling on TravisCI
Merge pull request #711 from rails-api/fixes-rbx-on-travis

Fixes rbx gems bundling on TravisCI
Merge pull request #710 from ride/fix-empty-linked

JSON-API: Don't include linked section if associations are empty
Include 'linked' member for json-api collections

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.
Define as_json instead of to_json
Merge pull request #714 from ride/to-json-as-json

Define as_json instead of to_json
Merge pull request #692 from ggordon/linked_for_jsonapi_collection

Include 'linked' member for json-api collections
Support serializer and each_serializer in render json
Allow for the implicit use of ArraySerializer when :each_serializer is specified.
Fix infinite recursion

The method for testing whether to include an association was causing
an infinite loop when two models referenced each other.
Merge pull request #1 from metermd/master

Allow for the implicit use of ArraySerializer when :each_serializer is specified
Merge pull request #722 from ggordon/stack_level_too_deep

Fix infinite recursion
Bugfix: include nested has_many association

Currently, doing `include: author.bio` would work correctly, but not for
has_many associations such as `include: author.roles`. This fixes it.

The problem was basically that we were not handling arrays for has_many linked,
as happens for ArraySerializers.
Merge pull request #726 from rails-api/json-api-include-with-nested-has-many

Bugfix: include nested has_many associations
Includes links inside of linked resources

According to
http://jsonapi.org/format/#document-structure-resource-objects,

> Resource objects have the same internal structure, regardless of
> whether they represent primary or linked resources.

And then
http://jsonapi.org/format/#document-structure-resource-object-attributes,

> There are four reserved keys in resource objects:
>
> "id"
> "type"
> "href"
> "links"

This commits includes `links` inside of linked resources.