emberjs / emberjs/ember-inflector

Method singularize error depending on the order of the irregular entries

Open
#119 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
107
Forks
78
Avg merge
20h 58m
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.