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

autoFetch does not work with extendsTo relations #323

Closed
ptnplanet opened this issue Sep 3, 2013 · 4 comments
Closed

autoFetch does not work with extendsTo relations #323

ptnplanet opened this issue Sep 3, 2013 · 4 comments

Comments

@ptnplanet
Copy link

Is this an intended behavior? It seems to me, that extendsTo relations ignore the autoFetch option. Regardless if the option is defined on the extension or the query itself.

Here is an example, that does not work as expected.

var User = db.define('user', { /* ... */ });
var Account = User.extendsTo('account', { /* ... */ }, { autoFetch: true });

User.find({ /* */ }, { autoFetch: true }, /* ... */);
@dresende
Copy link
Owner

Does it throw? It throws on my test (Missing Model.get() callback).

var Person = db.define('person', {
    name : String
});
var Account = Person.extendsTo('account', {
    username : String
}, {
    autoFetch : true
});

Person.one({ name : "John" }, function (err, John) {
    console.log(John);
});

@dresende
Copy link
Owner

Please test the latest commit:

npm install dresende/node-orm2

@dresende
Copy link
Owner

If the latest version doesn't work please reopen.

@ptnplanet
Copy link
Author

Nice, works for me. Thanks!

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