Skip to content

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

Closed

Description

@veilevil

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);
});

Activity

  1. dresende commented on May 2, 2013

    @dresende
    Owner

    It shouldn't, I'll try it.

  2. dresende commented on May 3, 2013

    @dresende
    Owner

    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.

  3. veilevil commented on May 3, 2013

    @veilevil
    Author

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

  4. dresende commented on May 3, 2013

    @dresende
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions