From d2f25088257ab896015d2182fa9aa272cc879360 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 24 Oct 2013 13:40:24 -0200 Subject: [PATCH] Reuse ivar --- test/unit/active_model/serializer/has_many_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/active_model/serializer/has_many_test.rb b/test/unit/active_model/serializer/has_many_test.rb index a64562cf..77e27875 100644 --- a/test/unit/active_model/serializer/has_many_test.rb +++ b/test/unit/active_model/serializer/has_many_test.rb @@ -86,7 +86,7 @@ module ActiveModel CONFIG.embed = :ids CONFIG.include = true - PostSerializer._associations[:comments].send :initialize, @association.name, @association.options + @association.send :initialize, @association.name, @association.options assert_equal({ 'post' => { title: 'Title 1', body: 'Body 1', 'comment_ids' => @post.comments.map { |c| c.object_id } }, @@ -100,7 +100,7 @@ module ActiveModel CONFIG.embed = nil CONFIG.include = true - PostSerializer._associations[:comments].send :initialize, @association.name, @association.options + @association.send :initialize, @association.name, @association.options assert_equal({ 'post' => { title: 'Title 1', body: 'Body 1' },