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), .