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 # @param [Hash{Symbol => Object}] options
# #
# @example # @example
# Association.new(:comments, CommentSummarySerializer, embed: :ids) # Association.new(:comments, CommentSummarySerializer)
# #
Association = Struct.new(:name, :serializer, :options) do 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 cache key:'writer', skip_digest: true
attributes :id, :name attributes :id, :name
has_many :posts, embed: :ids has_many :posts
has_many :roles, embed: :ids has_many :roles
has_one :bio has_one :bio
end end

View File

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

View File

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