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:
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user