Add plural_default_root config option

This commit is contained in:
Gauthier Delacroix
2014-09-12 18:56:51 +02:00
parent 40d6655c24
commit efa22d9d44
2 changed files with 7 additions and 1 deletions

View File

@@ -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)