mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Fix example code in doc/general/getting_started.md
The `belongs_to` method should take relation name, not a foreign_key property.
This commit is contained in:
parent
80e470dcdb
commit
cec6478f32
@ -37,7 +37,7 @@ and
|
|||||||
class CommentSerializer < ActiveModel::Serializer
|
class CommentSerializer < ActiveModel::Serializer
|
||||||
attributes :name, :body
|
attributes :name, :body
|
||||||
|
|
||||||
belongs_to :post_id
|
belongs_to :post
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user