mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Always use plural for linked types
Although spec is agnostic about inflection rules, examples given are plural
This commit is contained in:
@@ -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 = {})
|
||||
|
||||
Reference in New Issue
Block a user