-
-
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
model relationships get by string or class? #5804
Labels
🏷️ doc
This PR adds/improves/or fixes documentation
Comments
Hi @yaxinr, usage questions like this belong being asked on the Ember discord, discuss forum, or stack overflow. It seems you answered your own question though: you access by |
Reopening as I realized you were trying to point out a mistake in the documentation. Thank you! You are correct that there is one. |
rajasegar
added a commit
to rajasegar/data
that referenced
this issue
Mar 4, 2019
Fixes emberjs#5804 Access relationships by model name like relationships.get('user');
@runspired Raised a PR #5891 for the same, kindly verify |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
data/addon/-private/system/model/model.js
Line 1487 in 8fabf96
import Blog from 'app/models/blog';
import User from 'app/models/user';
import Post from 'app/models/post';
let relationships = Ember.get(Blog, 'relationships');
WRONG: relationships.get(User);
THIS WORKS: relationships.get('user');
The text was updated successfully, but these errors were encountered: