Always use plural for linked types

Although spec is agnostic about inflection rules, examples given are plural
This commit is contained in:
Mateo Murphy
2015-03-20 14:17:03 -04:00
parent 0f55f21266
commit d82c599c68
9 changed files with 51 additions and 51 deletions

View File

@@ -118,12 +118,7 @@ module ActiveModel
def serialized_object_type(serializer)
return false unless Array(serializer).first
type_name = Array(serializer).first.object.class.to_s.demodulize.underscore
if serializer.respond_to?(:first)
type_name.pluralize
else
type_name
end
Array(serializer).first.object.class.to_s.demodulize.underscore.pluralize
end
def add_resource_links(attrs, serializer, options = {})