-
Notifications
You must be signed in to change notification settings - Fork 376
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
With association autoFetch cache may return incomplete instance. #685
base: master
Are you sure you want to change the base?
Conversation
Has one with zero ID
…l the associations populated
@@ -112,6 +127,7 @@ function Model(opts) { | |||
extend_associations : extend_associations, | |||
association_properties : association_properties, | |||
setupAssociations : setupAssociations, | |||
checkAssociations : checkAssociations, |
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.
Could you please rename this to hasAutoFetchAssociationsLoaded
?
It's a bit long, but more indicative of what it's actually doing.
How does this behave when someone manually specifies Also could you please convert spaces to tabs? It will help with alignment issues. |
re: using Maybe setting |
…utoFetch' setting from the association definition.
…s more descriptive, if a little long
… functions; particularly for mongodb
…ton for the associative entity needs to include both keys to be sure we get the right set of extra data
Extend UID for Singleton when hasMany relationship has extra data
When cache has instance that has been loaded from auto-fetch, autoFetchLimit means can sometimes have instance in cache with no associations populated.
A subsequent independent get() or find() will return the underpopulated instance from the cache.
Updated the Singleton cache to check all autoFetch associations are populated before re-using object from cache.