I would like to suggest adding the findByAssociation method to models that are extended using extendsTo just like the one the hasOne association provides.
var User = db.define({
username: String
});
var Account = User.extendsTo({
facebookId: String
}, {
table: 'account'
} );
// This would be nice:
User.findByAccount({
facebookId: '123456789'
}, function (err, user) {
// user
});
I don't quite understand, why this is possible though:
Account.findByUser({
username: 'dude'
}, function (err, account) {
// account
});
I would like to suggest adding the
findByAssociationmethod to models that are extended usingextendsTojust like the one thehasOneassociation provides.I don't quite understand, why this is possible though: