Ember Data does not find the model, although it is clear there

I had so many others that I updated my ember application to the latest version, but after updating my application still does not work.

I have simplified a lot and it comes down to my route. My route is similar to this (as indicated in the transition guide):

App.BoxesRoute = Ember.Route.extend({ model: function(){ return this.store.find('box'); } }); 

Extremely simple and nothing should be wrong, right? My model looks like this:

 App.Box = DS.Model.extend({ enabled: DS.attr('boolean'), updatedAt: DS.attr('date'), boxMeters: DS.hasMany('App.BoxMeter') }); 

App.BoxMeter is very similar, but most importantly - it all worked before I upgraded to 1.0.0.

I get a couple of errors thrown into my face. It:

 Assertion failed: No model was found for 'App.Box' ember.js?body=1:394 Error while loading route: TypeError {} ember.js?body=1:394 Uncaught TypeError: Cannot set property 'store' of undefined 

none of this makes any sense to me. I have looked through routes and models countless times, and it's just .. weird! How do i solve this?

+7
ember-data
03 Sep '13 at 9:24
source share
1 answer

Try replacing this line:

 boxMeters: DS.hasMany('App.BoxMeter') 

from:

 boxMeters: DS.hasMany('boxMeter') 
+19
03 Sep '13 at 9:40
source share



All Articles