Skip to content

Commit da85d94

Browse files
committed
Remove unrelated code from attribute override examples
1 parent 8981683 commit da85d94

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

docs/general/serializers.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ If you want to override any association, you can use:
188188

189189
```ruby
190190
class PostSerializer < ActiveModel::Serializer
191-
attributes :id, :body
192-
193191
has_many :comments
194192

195193
def comments
@@ -204,9 +202,7 @@ If you want to override any attribute, you can use:
204202

205203
```ruby
206204
class PostSerializer < ActiveModel::Serializer
207-
attributes :id, :body
208-
209-
has_many :comments
205+
attributes :body
210206

211207
def body
212208
object.body.downcase

0 commit comments

Comments
 (0)