Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practice for displaying embedded records #45

Closed
rickharrison opened this issue Apr 15, 2014 · 6 comments
Closed

Best practice for displaying embedded records #45

rickharrison opened this issue Apr 15, 2014 · 6 comments

Comments

@rickharrison
Copy link

I am currently getting an error when trying to display embedded records like this:

{{#each items}}
  <li>{{title}}</li>
{{/each}}

The error is: You looked up the 'items' relationship on '<model:list::ember432:-JKbC-s23w5_Wy8MvAc0>' but some of the associated records were not loaded. Either make sure they are all loaded together with the parent reco...<omitted>...)

Is there a best practice for a way to display embedded records? I noticed that If I remove the call to adapter._enqueue in extractSingle it works, so this must be a race condition.

@aputinski
Copy link
Collaborator

@rickharrison are you using the embedded: true on your model attribute?

@rickharrison
Copy link
Author

Yes, I am. Here is my model definition:

var ListModel = DS.Model.extend({
  name: DS.attr('string'),
  items: DS.hasMany('item', { embedded: true })
});

@aputinski
Copy link
Collaborator

@rickharrison can you send me screenshot of what the data looks like in Firebase?

@rickharrison
Copy link
Author

Screenshot: http://cl.ly/image/1p330p3E0p3t

@aputinski
Copy link
Collaborator

@rickharrison good call about the adapter._enqueue. This actually isn't needed here, so I'll remove it and it should fix the problem.

@rickharrison
Copy link
Author

Thanks for the help. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants