diff options
Diffstat (limited to 'app/models/file.js')
-rw-r--r-- | app/models/file.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/file.js b/app/models/file.js index c9155e8..f04e01d 100644 --- a/app/models/file.js +++ b/app/models/file.js @@ -1,7 +1,7 @@ 'use strict'; -var mongoose = require('mongoose'), - Schema = mongoose.Schema, +var mongoose = require('mongoose'); +var Schema = mongoose.Schema, ObjectId = Schema.ObjectId; var FileSchema = new Schema({ @@ -34,7 +34,7 @@ var FileSchema = new Schema({ } }); -FileSchema.virtual('url').get(function(file) { +FileSchema.virtual('url').get(function() { return 'files/' + this._id + '/' + encodeURIComponent(this.name); }); |