mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Add configuration option to set resource type to singular/plural with jsonapi.
This commit is contained in:
@@ -135,7 +135,11 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def json_api_type
|
||||
object.class.model_name.plural
|
||||
if config.jsonapi_resource_type == :plural
|
||||
object.class.model_name.plural
|
||||
else
|
||||
object.class.model_name.singular
|
||||
end
|
||||
end
|
||||
|
||||
def attributes(options = {})
|
||||
|
||||
Reference in New Issue
Block a user