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