I'm building a simple Ember application using Ember v1.0.0 and Ember-Data v1.0.0-beta.3. I have a model called 'Categoria'
categoria.coffee:
App.Categoria = DS.Model.extend
nombre: DS.attr 'string'
simplified: DS.attr 'boolean'
candidatos: DS.hasMany 'candidato'
When I try to find a 'Categoria' by it's id, I always get error message: Assertion failed: No model was 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've specified the inflections rules, due the spanish-named 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'm wondering if the find method of the Store uses a different set of inflections rules? or is there any other place where I should declare the inflection rules for this model?
It worths to mention that requests to the server for this model are made correctly (to the right URL) and they're responded well formed.
I've tried to use different syntax for the store.find
method as mentioned in the Ember Guides#Method Find (http://emberjs.com/api/data/classes/DS.Store.html#method_find) but the error is the same.