diff options
Diffstat (limited to 'models/unsavedEdits.js')
-rw-r--r-- | models/unsavedEdits.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/models/unsavedEdits.js b/models/unsavedEdits.js index 25952fb5..d4f3616a 100644 --- a/models/unsavedEdits.js +++ b/models/unsavedEdits.js @@ -26,6 +26,9 @@ if (Meteor.isServer) { function isAuthor(userId, doc, fieldNames = []) { return userId === doc.userId && fieldNames.indexOf('userId') === -1; } + Meteor.startup(() => { + UnsavedEditCollection._collection._ensureIndex({ userId: 1 }); + }); UnsavedEditCollection.allow({ insert: isAuthor, update: isAuthor, |