ember-inflector
ember-inflector copied to clipboard
Method singularize error depending on the order of the irregular entries
Using ember 2.11.0 and ember-data 2.11.0.
My file app/initializers/inflector.js:
var inflector = Ember.Inflector.inflector;
inflector.irregular('entidade', 'entidades');
inflector.irregular('bem', 'bens');
inflector.irregular('conta-contabil', 'contas-contabeis');
inflector.irregular('descricao-padronizada', 'descricoes-padronizadas');
inflector.irregular('grupo', 'grupos');
inflector.irregular('localizacao', 'localizacoes');
inflector.irregular('orgao-externo', 'orgaos-externos');
inflector.irregular('pessoa', 'pessoas');
inflector.irregular('repositorio-bem', 'repositorios-bens');
inflector.irregular('session', 'sessions');
inflector.irregular('unidade-gestora', 'unidades-gestoras');
inflector.irregular('user', 'users');
singularize('repositorios-bens')
return 'repositorios-bem'
(WRONG !!!).
if i use the following (repositorio-bem before bem):
var inflector = Ember.Inflector.inflector;
inflector.irregular('entidade', 'entidades');
inflector.irregular('repositorio-bem', 'repositorios-bens');
inflector.irregular('bem', 'bens');
inflector.irregular('conta-contabil', 'contas-contabeis');
inflector.irregular('descricao-padronizada', 'descricoes-padronizadas');
inflector.irregular('grupo', 'grupos');
inflector.irregular('localizacao', 'localizacoes');
inflector.irregular('orgao-externo', 'orgaos-externos');
inflector.irregular('pessoa', 'pessoas');
inflector.irregular('session', 'sessions');
inflector.irregular('unidade-gestora', 'unidades-gestoras');
inflector.irregular('user', 'users');
singularize('repositorios-bens')
return 'repositorios-bens'
(RIGHT !!!).
Hope to help making ember better and better.
Cheers,
Antonio.
I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue. Since it's quite old, would you mind checking if this is still an issue with the latest version? If it isn't, maybe we can close this issue?
By closing some old issues we reduce the list of open issues to a more manageable set.