mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Add plural_default_root config option
This commit is contained in:
@@ -72,7 +72,10 @@ end
|
||||
alias root= _root=
|
||||
|
||||
def root_name
|
||||
name.demodulize.underscore.sub(/_serializer$/, '') if name
|
||||
if name
|
||||
root_name = name.demodulize.underscore.sub(/_serializer$/, '')
|
||||
CONFIG.plural_default_root ? root_name.pluralize : root_name
|
||||
end
|
||||
end
|
||||
|
||||
def attributes(*attrs)
|
||||
|
||||
Reference in New Issue
Block a user