Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Confused on adapter initialisation #26

Closed
avanc opened this issue Apr 3, 2013 · 2 comments
Closed

Confused on adapter initialisation #26

avanc opened this issue Apr 3, 2013 · 2 comments

Comments

@avanc
Copy link

avanc commented Apr 3, 2013

I had a look in the ember documentation (http://emberjs.com/guides/models/defining-a-store/) and wonder why it is so different to this example (https://gist.github.com/pangratz/4462422).

Why is in the one example DS.Store.extend() used while in the other DS.Store.create(). I'm quite confused by all the automagic introduced by emberjs, as almost always are classes extended but never create objects. How does App.Person = DS.Model.extend(...) knows which store to use when App.Post.find() is invoked (http://emberjs.com/guides/models/finding-models/).

This might be the wrong place to ask those questions. However, I'm a little bit lost in this topics.

@pangratz
Copy link
Owner

pangratz commented Apr 3, 2013

Hey!

My Gist is relatively old and if I remember correctly at the time of writing the Store for an application wasn't instantiated automatically when an Ember.Application has been created. So the App.Store = DS.Store.extend() way is the way to go.

You second question about where a model knows on which store to invoke the method is answered here.

I hope my comments helped you, otherwise it might be better to ask question either on StackOverflow or on the #emberjs IRC channel.

Cheers!

@pangratz pangratz closed this as completed Apr 3, 2013
@pangratz
Copy link
Owner

pangratz commented Apr 3, 2013

This issue also suggests to finally find some time to address #13.

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

No branches or pull requests

2 participants