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 12, 2018
1 parent e3d13a8 commit f7730d7
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,5 +1,6 @@
const {SURVEYS_COLLECTION} = process.env;
const mongoose = require('mongoose');
const history = require('mongoose-history');

const logger = require('../helpers/logger');
const dwelling = require('./dwelling');
Expand All @@ -13,4 +14,4 @@ module.exports = mongoose.model('SurveyAddress', new Schema({
user: {type: ObjectId, required: true},
address: {type: ObjectId, ref: 'Address', required: true},
state: {type: Number}
}, {collection: SURVEYS_COLLECTION, timestamps: true}));
}, {collection: SURVEYS_COLLECTION, timestamps: true}).plugin(history));

0 comments on commit f7730d7

Please sign in to comment.