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/serializers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Where:
65
65
-`virtual_value:`
66
66
-`polymorphic:` defines if polymorphic relation type should be nested in serialized association.
67
67
-`type:` the resource type as used by JSON:API, especially on a `belongs_to` relationship.
68
-
-`class_name:` used to determine `type` when `type` is not given. `class_name` option to supply the model name as string.
68
+
-`class_name:`the (String) model name used to determine `type`, when `type` is not given. e.g. `class_name: "Comment"` would imply the type `comments`
69
69
-`foreign_key:` used by JSON:API on a `belongs_to` relationship to avoid unnecessarily loading the association object.
70
70
-`namespace:` used when looking up the serializer and `serializer` is not given. Falls back to the parent serializer's `:namespace` instance options, which, when present, comes from the render options. See [Rendering#namespace](rendering.md#namespace] for more details.
71
71
- optional: `&block` is a context that returns the association's attributes.
0 commit comments