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 @@ -524,15 +524,15 @@ Now, any associations will be supplied as an Array of IDs:
524
524
}
525
525
```
526
526
527
- You may also choose to embed the IDs by the association's name underneath an
528
- ` embed_key ` for the resource. For example, say we want to change ` comment_ids `
527
+ You may also choose to embed the IDs by the association's name underneath a
528
+ ` key ` for the resource. For example, say we want to change ` comment_ids `
529
529
to ` comments ` underneath a ` links ` key:
530
530
531
531
``` ruby
532
532
class PostSerializer < ActiveModel ::Serializer
533
533
attributes :id , :title , :body
534
534
535
- has_many :comments , embed: :ids , embed_namespace: :links
535
+ has_many :comments , embed: :ids , key: :comments , embed_namespace: :links
536
536
end
537
537
```
538
538
@@ -694,7 +694,7 @@ class PostSerializer < ActiveModel::Serializer
694
694
embed :ids , include: true
695
695
696
696
attributes :id , :title , :body
697
- has_many :comments , embed_key : :external_id
697
+ has_many :comments , key : :external_id
698
698
end
699
699
```
700
700
You can’t perform that action at this time.
0 commit comments