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

Update the relationship docs to remove some references to a globals s… #4518

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

bmac
Copy link
Member

@bmac bmac commented Aug 26, 2016

…tyle namespace

@@ -171,7 +171,7 @@ export const RelationshipsClassMethodsMixin = Ember.Mixin.create({
});
```

Calling `App.Post.typeForRelationship('comments')` will return `App.Comment`.
Calling `postRecord.constructor.typeForRelationship('comments')` will return `Comment`.
Copy link
Member

@pangratz pangratz Aug 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recall correctly, @fivetanley had some thoughts of not advertising constructor publicly? Just want to double check...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, also it looks like typeForRelationship needs the store to be passed as 2nd argument...

@bmac bmac force-pushed the clean-up-some-references-to-app branch from a75a7ea to 9f1d6b1 Compare October 21, 2016 18:02
Copy link
Member

@pangratz pangratz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the missing @param {DS.Store} store argument to the inverseFor doc, while you're at it?

Thanks!

@@ -171,7 +171,7 @@ export const RelationshipsClassMethodsMixin = Ember.Mixin.create({
});
```

Calling `App.Post.typeForRelationship('comments')` will return `App.Comment`.
Calling `postRecord.constructor.typeForRelationship('comments', store)` will return `Comment`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetanley if I recall correctly you had some thoughts on not advertising the use of constructor?

@bmac what do you think of using store.modelFor("post").typeForRelationship("comments") instead?

@bmac bmac force-pushed the clean-up-some-references-to-app branch from 9f1d6b1 to 2a66b5c Compare October 26, 2016 16:02
@bmac bmac force-pushed the clean-up-some-references-to-app branch from 2a66b5c to 65006cc Compare October 26, 2016 16:03
@bmac
Copy link
Member Author

bmac commented Oct 26, 2016

Done @pangratz.

@pangratz pangratz merged commit 37f5413 into emberjs:master Oct 27, 2016
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

Successfully merging this pull request may close these issues.

2 participants