Skip to content

Add findByAssociation to extendsTo #314

Description

@ptnplanet

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

Activity

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