Skip to content

Commit

Permalink
feat(model): add mongoose-history plugin for SurveyAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
navarroaxel committed Oct 7, 2018
1 parent 18bb2fb commit 96b3c99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"gulp-load-plugins": "1.5.0",
"gulp-mocha": "6.0.0",
"husky": "^1.1.1",
"mongoose-history": "^0.6.0",
"should": "13.2.3",
"sinon": "6.3.5",
"superagent": "^4.0.0-beta.5",
Expand Down
3 changes: 2 additions & 1 deletion src/model/surveyAddress.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const mongoose = require('mongoose');
const history = require('mongoose-history');

const dwelling = require('./dwelling');

Expand All @@ -9,4 +10,4 @@ module.exports = mongoose.model('SurveyAddress', new Schema({
user: {type: ObjectId, required: true},
address: {type: ObjectId, ref: 'Address', required: true},
state: {type: Number}
}, {collection: 'surveyAddresses', timestamps: true}));
}, {collection: 'surveyAddresses', timestamps: true}).plugin(history));

0 comments on commit 96b3c99

Please sign in to comment.