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

Can I use both option 'reverse' and 'autoFetch' in one Association? #144

Closed
veilevil opened this issue May 2, 2013 · 4 comments
Closed

Comments

@veilevil
Copy link

veilevil commented May 2, 2013

Hey guys
It appears to have entered into a infinite loop when I use both option 'reverse' and option 'autoFetch' in one association
Is this a bug?
My code:

var Pet = db.define('pet', {
    name : String
});
var Person = db.define('person', {
    name : String
});
Person.hasMany("pets", Pet, {
}, {
    autoFetch:true,
    reverse : "owners"
});
Person.get(1, function(err, site) {
    return res.end(site);
});
@dresende
Copy link
Owner

dresende commented May 2, 2013

It shouldn't, I'll try it.

@dresende
Copy link
Owner

dresende commented May 3, 2013

There's really a bug, it starts looping infinitely. I think I predicted this somewhere in my commit comments, I have to see where it fails to avoid looping, because there's a way to avoid it (autoFetchLimit) and it's not working in this situation.

@veilevil
Copy link
Author

veilevil commented May 3, 2013

Thanks concerned,I fixed my code and removed one of them for temporary :)

@dresende
Copy link
Owner

dresende commented May 3, 2013

Could you please test the latest commit? I think I got it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants