mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
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. |
||
|---|---|---|
| .. | ||
| general | ||
| howto | ||
| integrations | ||
| jsonapi | ||
| rfcs | ||
| ARCHITECTURE.md | ||
| how-open-source-maintained.jpg | ||
| README.md | ||
| STYLE.md | ||
Docs - ActiveModel::Serializer 0.10.x
This is the documentation of ActiveModelSerializers, it's focused on the 0.10.x version.
General
- Getting Started
- Configuration Options
- Serializers
- Adapters
- Rendering
- Caching
- Logging
- Deserialization
- Instrumentation
- JSON API
- ARCHITECTURE
How to
- How to add root key
- How to add pagination links
- Using ActiveModelSerializers Outside Of Controllers
- Testing ActiveModelSerializers
- Passing Arbitrary Options
- How to serialize a Plain-Old Ruby Object (PORO)
- How to upgrade from
0.8to0.10safely
Integrations
| Integration | Supported ActiveModelSerializers versions | Gem name and/or link |
|---|---|---|
| Ember.js | 0.9.x | active-model-adapter |
| Ember.js | 0.10.x + | docs/integrations/ember-and-json-api.md |
| Grape | 0.10.x + | docs/integrations/grape.md |
| Grape | 0.9.x | https://github.com/jrhe/grape-active_model_serializers/ |
| Sinatra | 0.9.x | https://github.com/SauloSilva/sinatra-active-model-serializers/ |