mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Merge remote-tracking branch 'upstream/master' into feature/adapter
This commit is contained in:
@@ -31,7 +31,7 @@ serializers:
|
||||
|
||||
```ruby
|
||||
class PostSerializer < ActiveModel::Serializer
|
||||
attribute :title, :body
|
||||
attributes :title, :body
|
||||
|
||||
has_many :comments
|
||||
|
||||
@@ -43,7 +43,7 @@ and
|
||||
|
||||
```ruby
|
||||
class CommentSerializer < ActiveModel::Serializer
|
||||
attribute :name, :body
|
||||
attributes :name, :body
|
||||
|
||||
belongs_to :post
|
||||
|
||||
@@ -121,7 +121,7 @@ The generated seralizer will contain basic `attributes` and
|
||||
|
||||
```ruby
|
||||
class PostSerializer < ActiveModel::Serializer
|
||||
attribute :title, :body
|
||||
attributes :title, :body
|
||||
|
||||
has_many :comments
|
||||
|
||||
@@ -133,7 +133,7 @@ and
|
||||
|
||||
```ruby
|
||||
class CommentSerializer < ActiveModel::Serializer
|
||||
attribute :name, :body
|
||||
attributes :name, :body
|
||||
|
||||
belongs_to :post_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user