Open smithcommajoseph opened 10 years ago
Calling App.Comment.find()
will find all currently loaded comments care of the posts they were loaded from. Each model class maintains an internal identity map/cache of all records of that type as well as a sideload data cache for any data that has not yet been materialised into records.
If you want to fetch comments from the server, then by configuring the appropriate REST endpoint as you have done for say Post
on your Comment
model, you should just be able to fetch them and no special adapter is required.
@ahacking what you describe, using App.Comment.find()
is what I would expect (which appears to call findAll
if no arguments are passed), however I consistently get a error 'Ember.Adapter must implement findAll'.
This is why I ask, what would the adapter need to look like to implement this?
What adapter have you configured on your comment model? Are you using the built in REST adapter or something else?
I have this request for knowledge documented here, but it has one unanswered for a few days, so I'm posting here in hopes someone will have an answer. http://stackoverflow.com/questions/25452380/working-with-ember-model-adapters-that-only-deal-with-sideloaded-data.
Ember-model's documentation has an example like the following
If I wanted to implement an adapter so I could findAll comments, via App.Comment.findAll(), what would that look like?
Once this process is understood, I would be happy to submit a PR with an update to the README to include this process as I think it could be helpful to others.