1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-18 23:01:30 +00:00

Edit and sharing should be working, deploying for testing

This commit is contained in:
Scott Tolksdorf
2015-12-20 14:21:25 -05:00
parent ef7a500940
commit 8a4d840717
7 changed files with 175 additions and 39 deletions

View File

@@ -6,13 +6,33 @@ var HomebrewSchema = mongoose.Schema({
editId : {type : String, default: shortid.generate},
text : {type : String, default : ""},
created : { type: Date, default: Date.now },
createdAt : { type: Date, default: Date.now },
updatedAt : { type: Date}
});
//Schema Options
HomebrewSchema.pre('save', function(done) {
this.updatedAt = new Date();
done();
});
/*
HomebrewSchema.options.toJSON.transform = function (doc, ret, options) {
delete ret._id;
delete ret.__t;
delete ret.__v;
}
HomebrewSchema.options.toObject.transform = function (doc, ret, options) {
delete ret._id;
delete ret.__t;
delete ret.__v;
}
*/
var Homebrew = mongoose.model('Homebrew', HomebrewSchema);
module.exports = {
schema : HomebrewSchema,
model : Homebrew,
}
}