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
Give Model a static toString method #5117
Give Model a static toString method #5117
Conversation
d58fe83
to
33650a0
Compare
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.
Seems good to me!
If you rebase (to get 49a66fe) this should pass in CI... |
33650a0
to
99be41b
Compare
@runspired - Wanted to get your thoughts here too... |
I thought Stef had recently fixed this, hrm |
This is fixed, if you load models via the container and a modern resolver. The above should only benefit tests. And if so, should likely be a test specific reopen. |
@stefanpenner, can you elaborate? This code: model() {
return RSVP.hash({
nodes: this.get('store').findAll('node'),
agents: this.get('store').findAll('agent'),
}).then(({ nodes }) => {
console.log(nodes.get('firstObject').toString());
console.log(nodes.get('firstObject').constructor.toString());
});
}, Yields this output:
With these dependencies:
Was this fixed after 2.14.4, or is there another explanation? |
ah.. |
This seems reasonable, unless we want to remove I'll have to think about this some more. |
IMHO, deprecating |
On the class, I don't believe we put |
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.
I think we would like to move away from modelName
on class's. This would be at odds with that goal. I'm not sure how to proceed.
I don't believe it is possible for us to move off of @rwjblue @stefanpenner what do you think? |
Moving away from modelName just means we need some other mechanism for the same rough thing, whenever we add that we can easily update this |
This changes the dreaded (unknown mixin) to something like model:person.
e93fe0c
to
13c4094
Compare
This changes the dreaded
(unknown mixin)
to something likemodel:person
.This will make things like this error much more useful: