Skip to content

Commit

Permalink
Crucial connection update, redoing release!
Browse files Browse the repository at this point in the history
  • Loading branch information
Snkz committed Nov 13, 2014
1 parent efd5107 commit cb8c2de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The \_\_v field is used by mongoose to help with concurrent updates, this is not

The rollback model is stored in a seperate collection, the name is specified in the plugin options, \_hist is appened to the name. It is recommended you use the same collection name as the Schema you intend to keep history for.

Make sure to supply your connection name as an option (conn: mongodb://host/db} to the options field. Sometimes it can work without, most of the times no.
Make sure to supply your connection name as an option (conn: mongodb://host/db} to the options field if you intend to use a seperate connection!.

DELETES CASCADE! Delete your model => history is removed. I trust that you know what youre doing.

Expand Down
4 changes: 2 additions & 2 deletions mongoose-rollback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var RollbackSchema = require('./models/rollback.js');
var mongoose = require('mongoose');
var buildRollbackMethods = require('./lib/methods.js');
var buildSaveMethods = require('./lib/save.js');
var buildStaticFunctions = require('./lib/statics.js');
Expand All @@ -17,7 +16,8 @@ function rollbackPlugin (schema, options) {
})

// assumes connection happens before plugin or something? not sure but yea..
var conn = mongoose; // default connection in mongoose object;
var mongoose = require('mongoose');
var conn = mongoose;

// add index on version field
if (options && options.index) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongoose-rollback",
"version": "1.1.1",
"version": "1.1.2",
"description": "mongoose rollback machine",
"main": "mongoose-rollback.js",
"dependencies": {
Expand Down

0 comments on commit cb8c2de

Please sign in to comment.