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

when calling .find() on the instance of DS.Model it always has .isLoaded set to true #2632

Closed
ValMilkevich opened this issue May 5, 2013 · 5 comments

Comments

@ValMilkevich
Copy link

App.CurrentUser = DS.Model.extend(
email: DS.attr('string')
phone: DS.attr('string')
name: DS.attr('string')
);

App.CurrentUser.find().get('isLoaded')

true

App.CurrentUser.find({foo: 'bar'}).get('isLoaded')

false

@tchak
Copy link
Member

tchak commented May 5, 2013

yes this is a recent regression in ember-data

emberjs/data#827

@teddyzeenny
Copy link
Contributor

Actually I think this is a different issue. I think this is by design, because find() directly returns the records found in the store, so is considered to always be loaded, even on creation.

There has been a lot of confusion surrounding this, so maybe we should reconsider how it behaves?

@tchak
Copy link
Member

tchak commented May 5, 2013

@teddyzeenny oh you right, my bad.
So, yes this is by design, and we already talked about it a lot (#735). I am not particularly in favor of changing it as once one understand how and why it is working this way, it is consistent and avoid other confusions. There is no simple change here... But we can and should discuss a bigger plan.

@ValMilkevich
Copy link
Author

@tchak @teddyzeenny thanks for clarifications

@stefanpenner
Copy link
Member

this issue (if it still is an issue) likely belongs in https://github.com/emberjs/data/issues

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

No branches or pull requests

4 participants