This commit is contained in:
Tom Moor
2017-07-15 16:08:12 -07:00
parent 0caff8c393
commit 66e4995885
8 changed files with 15 additions and 12 deletions

View File

@@ -130,6 +130,11 @@ Document.associate = models => {
},
{ override: true }
);
Document.addScope('withStarred', userId => ({
include: [
{ model: models.Star, as: 'starred', where: { userId }, required: false },
],
}));
};
Document.findById = async id => {

View File

@@ -4,8 +4,6 @@ beforeEach(flushdb);
it('should set JWT secret and password digest', async () => {
const { user } = await seed();
await user.save();
expect(user.passwordDigest).toBeTruthy();
expect(user.getJwtToken()).toBeTruthy();