File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -513,15 +513,15 @@ Now, any associations will be supplied as an Array of IDs:
513
513
}
514
514
```
515
515
516
- You may also choose to embed the IDs by the association's name underneath an
517
- ` embed_key ` for the resource. For example, say we want to change ` comment_ids `
516
+ You may also choose to embed the IDs by the association's name underneath a
517
+ ` key ` for the resource. For example, say we want to change ` comment_ids `
518
518
to ` comments ` underneath a ` links ` key:
519
519
520
520
``` ruby
521
521
class PostSerializer < ActiveModel ::Serializer
522
522
attributes :id , :title , :body
523
523
524
- has_many :comments , embed: :ids , embed_namespace: :links
524
+ has_many :comments , embed: :ids , key: :comments , embed_namespace: :links
525
525
end
526
526
```
527
527
@@ -683,7 +683,7 @@ class PostSerializer < ActiveModel::Serializer
683
683
embed :ids , include: true
684
684
685
685
attributes :id , :title , :body
686
- has_many :comments , embed_key : :external_id
686
+ has_many :comments , key : :external_id
687
687
end
688
688
```
689
689
You can’t perform that action at this time.
0 commit comments