Skip to content

Commit 4559774

Browse files
committed
Updated the defination for the class_name in documentation
1 parent 993a48f commit 4559774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/general/serializers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Where:
6565
- `virtual_value:`
6666
- `polymorphic:` defines if polymorphic relation type should be nested in serialized association.
6767
- `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`
6969
- `foreign_key:` used by JSON:API on a `belongs_to` relationship to avoid unnecessarily loading the association object.
7070
- `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.
7171
- optional: `&block` is a context that returns the association's attributes.

0 commit comments

Comments
 (0)