From d556ef525f593ccb8c688e340f70659849ac74a3 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Tue, 30 Apr 2013 14:41:30 +0200 Subject: renamed files to match model names --- models/access.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 models/access.js (limited to 'models/access.js') diff --git a/models/access.js b/models/access.js deleted file mode 100644 index ce75f8c..0000000 --- a/models/access.js +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * Module dependencies - */ - -var mongoose = require('mongoose') - , Schema = mongoose.Schema; - -var AccessSchema = new Schema({ - user: { type: Schema.ObjectId, ref: 'User' }, - creator: { type: Schema.ObjectId, ref: 'User' }, - project: { type: Schema.ObjectId, ref: 'Project' }, - permissions: { type: Number, default: '3' }, - created: { type: Date, default: Date.now }, - updated: { type: Date, default: Date.now } -}); - -// the four validations below only apply if you are signing up traditionally - -AccessSchema.statics = { - - log: function() { - console.log('wat. wat logged this'); - }, - - /** - * Load ALL accesses for a single user - * - * @param {ObjectId} id - * @param {Function} callback - * @api private - */ - - loadUser: function(id, callback) { - this.find({ user: id }) - .populate('project') - .sort({ 'created': -1 }) // sort by date - .exec(callback); - } -} - -mongoose.model('Access', AccessSchema); -- cgit v1.2.3