Remove traces of embed option.

This commit is contained in:
Lucas Hosseini 2015-08-31 01:19:47 +02:00
parent 64168cbecd
commit c5446d759f
4 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@ module ActiveModel
# @param [Hash{Symbol => Object}] options
#
# @example
# Association.new(:comments, CommentSummarySerializer, embed: :ids)
# Association.new(:comments, CommentSummarySerializer)
#
Association = Struct.new(:name, :serializer, :options) do

View File

@ -136,8 +136,8 @@ AuthorSerializer = Class.new(ActiveModel::Serializer) do
cache key:'writer', skip_digest: true
attributes :id, :name
has_many :posts, embed: :ids
has_many :roles, embed: :ids
has_many :posts
has_many :roles
has_one :bio
end

View File

@ -6,7 +6,7 @@ module ActiveModel
AuthorSummarySerializer = Class.new
class AssociationsTestSerializer < Serializer
belongs_to :author, serializer: AuthorSummarySerializer
has_many :comments, embed: :ids
has_many :comments
has_one :category
end
@ -21,7 +21,7 @@ module ActiveModel
end
def test_has_many_defines_reflection
has_many_reflection = HasManyReflection.new(:comments, embed: :ids)
has_many_reflection = HasManyReflection.new(:comments, {})
assert_includes(@reflections, has_many_reflection)
end

View File

@ -52,13 +52,13 @@ module ActiveModel
case key
when :posts
assert_equal({ embed: :ids }, options)
assert_equal({}, options)
assert_kind_of(ActiveModel::Serializer.config.array_serializer, serializer)
when :bio
assert_equal({}, options)
assert_nil serializer
when :roles
assert_equal({ embed: :ids }, options)
assert_equal({}, options)
assert_kind_of(ActiveModel::Serializer.config.array_serializer, serializer)
else
flunk "Unknown association: #{key}"