Built-in objects in fixtures raise errors "unable to find fixtures"

I use ember-data adapter adapters to provide many settings in my application. For one model ("Structure"), there is an array of built-in related objects ("Overlay"). When I load an instance of Structure from the repository, request its overlays property, I get this error:

 Uncaught Error: assertion failed: Unable to find fixtures for model type App.Overlay 

Both models are defined as follows (to eliminate some other fields / relationships):

 App.Structure = DS.Model.extend({ // How this appears in lists name: DS.attr('string'), // Color to show this overlay with color: DS.attr('string'), // hash of overlay paths overlays: DS.hasMany('App.Overlay', { embedded: true }) }); App.Overlay = DS.Model.extend({ view: DS.attr('string'), path: DS.attr('string') }); 

I need only one fixture to demonstrate:

 App.Structure.FIXTURES = [{ "id": 0, "name": "Test Structure", "color": "#cc0033", "overlays": [{ 'view': 'Isometric', 'path': "M17.5,19.508V8.626h-3.999v10.881c-1.404,0.727-2.375,2.178-2.375,3.869c0,2.416,1.959,4.375,4.375,4.375s4.375-1.959,4.375-4.375C19.876,21.686,18.905,20.234,17.5,19.508zM20.5,5.249c0-2.757-2.244-5-5.001-5s-4.998,2.244-4.998,5v12.726c-1.497,1.373-2.376,3.314-2.376,5.4c0,4.066,3.31,7.377,7.376,7.377s7.374-3.311,7.374-7.377c0-2.086-0.878-4.029-2.375-5.402V5.249zM20.875,23.377c0,2.963-2.41,5.373-5.375,5.373c-2.962,0-5.373-2.41-5.373-5.373c0-1.795,0.896-3.443,2.376-4.438V5.251c0-1.654,1.343-3,2.997-3s3,1.345,3,3v13.688C19.979,19.934,20.875,21.582,20.875,23.377zM22.084,8.626l4.5,2.598V6.029L22.084,8.626z" }] }]; 

With this, I can load the structure:

 > var structure = App.fixtureStore.find(App.Structure, 0); > structure.get('name'); "Test Structure" 

But if I request its overlay, everything goes irrevocably:

 > structure.get('overlays'); Uncaught Error: assertion failed: Unable to find fixtures for model type App.Overlay 

What? Do I need to declare fixtures for this model, even if they are empty?

Here is the jsfiddle showing the error .

+1
source share
1 answer

And, a little more tuned to the violin shows that I need to declare empty fixtures for the model:

 App.Overlay.FIXTURES = []; 
+1
source

All Articles