From feaefeeef391be98d31005201976bcec5e597189 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 15 May 2013 16:26:55 -0700 Subject: [PATCH] Use name reader --- lib/active_model/serializer/associations.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/active_model/serializer/associations.rb b/lib/active_model/serializer/associations.rb index 4ef04176..6a73b386 100644 --- a/lib/active_model/serializer/associations.rb +++ b/lib/active_model/serializer/associations.rb @@ -23,7 +23,7 @@ module ActiveModel elsif use_id_key? id_key else - @name + name end end @@ -68,7 +68,7 @@ module ActiveModel end def id_key - "#{@name.to_s.singularize}_ids".to_sym + "#{name.to_s.singularize}_ids".to_sym end def serializables @@ -97,12 +97,12 @@ module ActiveModel elsif polymorphic? object.class.to_s.pluralize.demodulize.underscore.to_sym else - @name.to_s.pluralize.to_sym + name.to_s.pluralize.to_sym end end def id_key - "#{@name}_id".to_sym + "#{name}_id".to_sym end def embeddable?