* Merge pull request #1990 from mxie/mx-result-typo
Fix typos and capitalization in Relationship Links docs [ci skip]
* Merge pull request #1992 from ojiry/bump_ruby_versions
Run tests by Ruby 2.2.6 and 2.3.3
* Merge pull request #1994 from bf4/promote_architecture
Promote important architecture description that answers a lot of questions we get
Conflicts:
docs/ARCHITECTURE.md
* Merge pull request #1999 from bf4/typos
Fix typos [ci skip]
* Merge pull request #2000 from berfarah/patch-1
Link to 0.10.3 tag instead of `master` branch
* Merge pull request #2007 from bf4/check_ci
Test was failing due to change in JSON exception message when parsing empty string
* Swap out KeyTransform for CaseTransform (#1993)
* delete KeyTransform, use CaseTransform
* added changelog
Conflicts:
CHANGELOG.md
* Merge pull request #2005 from kofronpi/support-ruby-2.4
Update jsonapi runtime dependency to 0.1.1.beta6
* Bump to v0.10.4
* Merge pull request #2018 from rails-api/bump_version
Bump to v0.10.4 [ci skip]
Conflicts:
CHANGELOG.md
* Merge pull request #2019 from bf4/fix_method_redefined_warning
Fix AMS warnings
* Merge pull request #2020 from bf4/silence_grape_warnings
Silence Grape warnings
* Merge pull request #2017 from bf4/remove_warnings
Fix mt6 assert_nil warnings
* Updated isolated tests to assert correct behavior. (#2010)
* Updated isolated tests to assert correct behavior.
* Added check to get unsafe params if rails version is great than 5
* Merge pull request #2012 from bf4/cleanup_isolated_jsonapi_renderer_tests_a_bit
Cleanup assertions in isolated jsonapi renderer tests a bit
* Add Model#attributes helper; make test attributes explicit
* Fix model attributes accessors
* Fix typos
* Randomize testing of compatibility layer against regressions
* Test bugfix
* Add CHANGELOG
* Merge pull request #1981 from groyoh/link_doc
Fix relationship links doc
Conflicts:
CHANGELOG.md
* This adds namespace lookup to serializer_for
* address rubocop issue
* address @bf4's feedback
* add docs
* update docs, add more tests
* apparently rails master doesn't have before filter
* try to address serializer cache issue between tests
* update cache for serializer lookup to include namespace in the key, and fix the tests for explicit namespace
* update docs, and use better cache key creation method
* update docs [ci skip]
* update docs [ci skip]
* add to changelog [ci skip]
For JSONAPI, `include_data` currently means, "should we populate the
'data'" key for this relationship. Current options are true/false.
This adds the `:if_sideloaded` option. This means "only
populate the 'data' key when we are sideloading this relationship." This
is because 'data' is often only relevant to sideloading, and causes a
database hit.
Addresses https://github.com/rails-api/active_model_serializers/issues/1555
If you specify include_data false, and do not have any links for this
relationship, we would output something like:
`{ relationships: { comments: {} } }`
This is not valid jsonapi. We will now render
`{ relationships: { comments: { meta: {} } } }`
Instead.
Relevant jsonapi spec: http://jsonapi.org/format/#document-resource-object-relationships
* Make assocations asserts easier to understand
* Refactor Association into Field like everything else
* Make assocation serializer/links/meta lazier
* Push association deeper into relationship
* Simplify association usage in relationships
* Better naming of reflection parent serializer
* Easier to read association method
The `:attributes` adapter is the default one, but it did not support
key transformation. This was very surprising behavior, since the
"Configuration Options" page in the guides didn't mention that this
behavior was not supported by the attributes adapter.
This commit adds key transform support to the attributes adapter, and
adds documentation about the default transform for the attributes
adapter (which is `:unaltered`).
This commit also handles arrays when transforming keys, which was needed
in the case where you're serializing a collection with the Attributes
adapter. With the JSON adapter, it was always guaranteed to pass a hash
to the KeyTransform functions because of the top-level key. Since there
is no top-level key for the Attributes adapter, the return value could
be an array.
- improves improves serialization_context to take options and not depend
on a `request` object.
- adds descriptive error on missing serialization_context.
- Document overriding `CollectionSerializer#paginated?`.