mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
parent
db086794c6
commit
06e4c2c9d6
2
test/fixtures/active_record.rb
vendored
2
test/fixtures/active_record.rb
vendored
@ -71,7 +71,7 @@ class ARTagSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
class ARSectionSerializer < ActiveModel::Serializer
|
||||
attributes :name
|
||||
attributes 'name'
|
||||
end
|
||||
|
||||
ARPost.create(title: 'New post',
|
||||
|
||||
@ -17,7 +17,7 @@ module ActiveModel
|
||||
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
|
||||
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
|
||||
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
|
||||
ar_section: { name: 'ruby' }
|
||||
ar_section: { 'name' => 'ruby' }
|
||||
}
|
||||
}, post_serializer.as_json)
|
||||
end
|
||||
@ -51,7 +51,7 @@ module ActiveModel
|
||||
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
|
||||
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
|
||||
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
|
||||
ar_section: { name: 'ruby' }
|
||||
ar_section: { 'name' => 'ruby' }
|
||||
}, post_serializer.as_json)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user