mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Remove unrelated code from attribute override examples
This commit is contained in:
parent
8981683b9f
commit
da85d944d4
@ -188,8 +188,6 @@ If you want to override any association, you can use:
|
|||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class PostSerializer < ActiveModel::Serializer
|
class PostSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :body
|
|
||||||
|
|
||||||
has_many :comments
|
has_many :comments
|
||||||
|
|
||||||
def comments
|
def comments
|
||||||
@ -204,9 +202,7 @@ If you want to override any attribute, you can use:
|
|||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
class PostSerializer < ActiveModel::Serializer
|
class PostSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :body
|
attributes :body
|
||||||
|
|
||||||
has_many :comments
|
|
||||||
|
|
||||||
def body
|
def body
|
||||||
object.body.downcase
|
object.body.downcase
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user