Deprecate include in favor of side_load

This commit is contained in:
Santiago Pastorino
2013-10-24 15:09:26 -02:00
parent 48db253765
commit cef6f85f44
4 changed files with 13 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ module ActiveModel
def test_serialization_embedding_ids_including_in_root
post_serializer = ARPostSerializer.new(@post)
embed(ARPostSerializer, embed: :ids, include: true) do
embed(ARPostSerializer, embed: :ids, side_load: true) do
assert_equal({
'ar_post' => {
title: 'New post', body: 'A body!!!',
@@ -63,7 +63,7 @@ module ActiveModel
ARPostSerializer._associations.each_value do |association|
association.embed = options[:embed]
association.side_load = options[:include]
association.side_load = options[:side_load]
end
yield

View File

@@ -65,8 +65,8 @@ module ActiveModel
class ApplyConfigTest < ActiveModel::TestCase
def test_apply_config_to_associations
CONFIG.embed = :ids
CONFIG.include = true
CONFIG.embed = :ids
CONFIG.side_load = true
association = PostSerializer._associations[:comments]
old_association = association.dup