-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fixed modelFor documentation. Look up model's class name #4693
Conversation
```Represents the model's class name as a string. This can be used to look up the model's class name through DS.Store's modelFor method.``` This is wrong and should be `model's class name` since you don't look up the actual model but the name.
@@ -995,7 +995,7 @@ Model.reopenClass({ | |||
}, | |||
|
|||
/** | |||
Represents the model's class name as a string. This can be used to look up the model through | |||
Represents the model's class name as a string. This can be used to look up the model's class name through | |||
DS.Store's modelFor method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you wrap DS.Store
in a code fence while you're in there? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@locks done!
Represents the model's class name as a string. This can be used to look up the model through | ||
DS.Store's modelFor method. | ||
Represents the model's class name as a string. This can be used to look up the model's class name through | ||
`DS.Store`'s modelFor method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, so I can see how the original documentation is somehow misleading. In ember-data a model
basically means the class (something which extends DS.Model
) and a record
means an instance of a model (created via store.createRecord
).
store.modelFor
returns the class for the given name.
So what do you think of rephrasing the whole line into something like:
Represents a model's class name as a string, which can be used to lookup the class itself via
DS.Store
'smodelFor
method.
Not sure if that is actually better though. Just wanted to highlight that store.modelFor
returns the class. Hope that helps.
Thanks for helping out making the docs more clear @maartenparmentier! ❤️ |
Represents the model's class name as a string. This can be used to look up the model's class name through DS.Store's modelFor method.
This is wrong and should be
model's class name
since you don't look up the actual model but the name.