Skip to content

Commit

Permalink
Merge pull request #405 from picatic/master
Browse files Browse the repository at this point in the history
Pool and debug settings always are true
  • Loading branch information
dresende committed Dec 12, 2013
2 parents 202a723 + ee9b064 commit 4dca6d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ORM.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ exports.connect = function (opts, cb) {
var debug = extractOption(opts, "debug");
var pool = extractOption(opts, "pool");
var driver = new Driver(opts, null, {
debug : (debug !== null ? Boolean(debug) : settings.get("connection.debug")),
pool : (pool !== null ? Boolean(pool) : settings.get("connection.pool")),
debug : (debug !== null ? ((debug === "false" || debug === "0") ? false : true) : settings.get("connection.debug")),
pool : (pool !== null ? ((pool === "false" || pool === "0") ? false : true) : settings.get("connection.pool")),
settings : settings
});

Expand Down
9 changes: 9 additions & 0 deletions test/integration/orm-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ describe("ORM.connect()", function () {
return done();
});
});

it("should allow pool and debug settings to be false", function(done) {
var connString = common.getConnectionString() + "debug=false&pool=false";
ORM.connect(connString, function(err, db) {
db.driver.opts.pool.should.equal(false);
db.driver.opts.debug.should.equal(false);
done();
});
});
});
});

Expand Down

0 comments on commit 4dca6d3

Please sign in to comment.