mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
pluralising root key when using arraySerializer
This commit is contained in:
@@ -19,7 +19,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def json_key
|
||||
@objects.first.json_key if @objects.first
|
||||
@objects.first.json_key.pluralize if @objects.first
|
||||
end
|
||||
|
||||
def root=(root)
|
||||
|
||||
@@ -13,7 +13,7 @@ module ActiveModel
|
||||
|
||||
def fields_for(serializer)
|
||||
key = serializer.json_key
|
||||
fields[key.to_sym]
|
||||
fields[key.to_sym] || fields[key.pluralize.to_sym]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user