diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/user.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/models/user.js b/server/models/user.js index 351ffef86..d289da19a 100644 --- a/server/models/user.js +++ b/server/models/user.js | |||
@@ -19,6 +19,7 @@ UserSchema.methods = { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | UserSchema.statics = { | 21 | UserSchema.statics = { |
22 | count: count, | ||
22 | getByUsernameAndPassword: getByUsernameAndPassword, | 23 | getByUsernameAndPassword: getByUsernameAndPassword, |
23 | list: list, | 24 | list: list, |
24 | loadById: loadById, | 25 | loadById: loadById, |
@@ -29,6 +30,10 @@ mongoose.model('User', UserSchema) | |||
29 | 30 | ||
30 | // --------------------------------------------------------------------------- | 31 | // --------------------------------------------------------------------------- |
31 | 32 | ||
33 | function count (callback) { | ||
34 | return this.count(callback) | ||
35 | } | ||
36 | |||
32 | function getByUsernameAndPassword (username, password) { | 37 | function getByUsernameAndPassword (username, password) { |
33 | return this.findOne({ username: username, password: password }) | 38 | return this.findOne({ username: username, password: password }) |
34 | } | 39 | } |