Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pool and debug settings always are true #405

Merged
merged 4 commits into from
Dec 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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