added failing spec to show how both symbol and string keys are causing problems

This commit is contained in:
Kevin Bullaughey
2014-09-21 07:40:55 -04:00
parent 89f87bf855
commit 34d684ee9a
2 changed files with 39 additions and 0 deletions

12
test/fixtures/poro.rb vendored
View File

@@ -47,6 +47,12 @@ class Post < Model
end
end
class SpecialPost < Post
def special_comment
@speical_comment ||= Comment.new(content: 'special')
end
end
class Comment < Model
end
@@ -110,6 +116,12 @@ class PostSerializer < ActiveModel::Serializer
has_many :comments
end
class SpecialPostSerializer < ActiveModel::Serializer
attributes :title, :body
has_many :comments, root: :comments, embed_in_root: true, embed: :ids
has_one :special_comment, root: :comments, embed_in_root: true, embed: :ids
end
class CommentSerializer < ActiveModel::Serializer
attributes :content
end