Use name reader

This commit is contained in:
Santiago Pastorino 2013-05-15 16:26:55 -07:00
parent 296970415a
commit feaefeeef3

View File

@ -23,7 +23,7 @@ module ActiveModel
elsif use_id_key? elsif use_id_key?
id_key id_key
else else
@name name
end end
end end
@ -68,7 +68,7 @@ module ActiveModel
end end
def id_key def id_key
"#{@name.to_s.singularize}_ids".to_sym "#{name.to_s.singularize}_ids".to_sym
end end
def serializables def serializables
@ -97,12 +97,12 @@ module ActiveModel
elsif polymorphic? elsif polymorphic?
object.class.to_s.pluralize.demodulize.underscore.to_sym object.class.to_s.pluralize.demodulize.underscore.to_sym
else else
@name.to_s.pluralize.to_sym name.to_s.pluralize.to_sym
end end
end end
def id_key def id_key
"#{@name}_id".to_sym "#{name}_id".to_sym
end end
def embeddable? def embeddable?