mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06: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
|
end
|
||||||
|
|
||||||
class ARSectionSerializer < ActiveModel::Serializer
|
class ARSectionSerializer < ActiveModel::Serializer
|
||||||
attributes :name
|
attributes 'name'
|
||||||
end
|
end
|
||||||
|
|
||||||
ARPost.create(title: 'New post',
|
ARPost.create(title: 'New post',
|
||||||
|
|||||||
@ -17,7 +17,7 @@ module ActiveModel
|
|||||||
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
|
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
|
||||||
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
|
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
|
||||||
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
|
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
|
||||||
ar_section: { name: 'ruby' }
|
ar_section: { 'name' => 'ruby' }
|
||||||
}
|
}
|
||||||
}, post_serializer.as_json)
|
}, post_serializer.as_json)
|
||||||
end
|
end
|
||||||
@ -51,7 +51,7 @@ module ActiveModel
|
|||||||
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
|
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
|
||||||
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
|
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
|
||||||
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
|
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
|
||||||
ar_section: { name: 'ruby' }
|
ar_section: { 'name' => 'ruby' }
|
||||||
}, post_serializer.as_json)
|
}, post_serializer.as_json)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user