Does store.find () use different inflection rules from ember-inflector?

I am creating a simple Ember application using Ember v1.0.0 and Ember-Data v1.0.0-beta.3. I have a model called "Category"

categoria.coffee:

App.Categoria = DS.Model.extend
  nombre: DS.attr 'string'
  simplified: DS.attr 'boolean'
  candidatos: DS.hasMany 'candidato'

When I try to find the "Category" by this identifier, I always get the error message: Approval failed: no models found for 'categorium'

categoria_route.coffee:

App.CategoriaRoute = Em.Route.extend(
  model: (params)->
    @store.find('categoria', params.categoria_id)
)

App.CategoriaIndexRoute = Em.Route.extend(
  model: ->
    categoria = @modelFor('categoria')
    categoria.reload() if categoria.get('simplified') 
    categoria
)

I pointed out the rules of inflection, because of the Spanish model.

store.coffee:

Ember.Inflector.inflector.irregular('categoria', 'categorias')
Ember.Inflector.inflector.rules.irregularInverse['categorias'] = 'categoria'
App.ApplicationAdapter = DS.ActiveModelAdapter()
App.ApplicationSerializer = DS.ActiveModelSerializer.extend()

I am wondering if the find method in the store uses a different set of inflection rules? or is there another place where I should declare inflection rules for this model?

, ( URL), .

store.find, Ember Guides # Method Find (http://emberjs.com/api/data/classes/DS.Store.html#method_find), .

+4
1

, json-, categoria categorium, .

var iff = Ember.Inflector.inflector;

iff.irregular('categoria', 'categorias');
// this adds a test for when it finds categoria and you are trying to singularize, return categoria
iff.singular(/categoria/, 'categoria');

http://emberjs.jsbin.com/ICeGuzuX/3/edit

+6

All Articles