You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general/adapters.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,13 @@ resources in the `"included"` member when the resource names are included in the
25
25
`include` option.
26
26
27
27
```ruby
28
-
render @posts, include: ['authors', 'comments']
29
-
# or
30
-
render @posts, include:'authors,comments'
28
+
render @posts, include: ['authors', 'comments']
29
+
```
30
+
31
+
or
32
+
33
+
```ruby
34
+
render @posts, include:'authors,comments'
31
35
```
32
36
33
37
The format of the `include` option can be either a String composed of a comma-separated list of [relationship paths](http://jsonapi.org/format/#fetching-includes), an Array of Symbols and Hashes, or a mix of both.
|`ActiveModel::Serializer::Adapter.adapter_map`| A Hash of all known adapters { adapter_name => adapter_class } |
95
-
|`ActiveModel::Serializer::Adapter.adapters`| A (sorted) Array of all known adapter_names |
96
-
|`ActiveModel::Serializer::Adapter.lookup(name_or_klass)`| The adapter_class, else raises an `ActiveModel::Serializer::Adapter::UnknownAdapter` error |
97
-
|`ActiveModel::Serializer::Adapter.adapter_class(adapter)`| delegates to `ActiveModel::Serializer::Adapter.lookup(adapter)`|
98
-
|`ActiveModel::Serializer.adapter`| a convenience method for `ActiveModel::Serializer::Adapter.lookup(config.adapter)`|
98
+
| Method | Return value |
99
+
| :------------ |:---------------|
100
+
|`ActiveModel::Serializer::Adapter.adapter_map`| A Hash of all known adapters `{ adapter_name => adapter_class }`|
101
+
|`ActiveModel::Serializer::Adapter.adapters`| A (sorted) Array of all known `adapter_names`|
102
+
|`ActiveModel::Serializer::Adapter.lookup(name_or_klass)`| The `adapter_class`, else raises an `ActiveModel::Serializer::Adapter::UnknownAdapter` error |
103
+
|`ActiveModel::Serializer::Adapter.adapter_class(adapter)`| Delegates to `ActiveModel::Serializer::Adapter.lookup(adapter)`|
104
+
|`ActiveModel::Serializer.adapter`| A convenience method for `ActiveModel::Serializer::Adapter.lookup(config.adapter)`|
99
105
100
106
The registered adapter name is always a String, but may be looked up as a Symbol or String.
101
107
Helpfully, the Symbol or String is underscored, so that `get(:my_adapter)` and `get("MyAdapter")`
0 commit comments