Skip to content

Commit

Permalink
Closes #1350 - even better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Refael Ackermann committed Sep 29, 2013
1 parent 80e4da8 commit ba3f54f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2554,16 +2554,16 @@ Model.__subclass = function subclass (conn, schema, collection) {
? schema
: model.prototype.schema;

s.options = s.options || {};
var options = s.options || {};

if (!collection) {
collection = model.prototype.schema.get('collection')
|| utils.toCollectionName(model.modelName, s.options);
|| utils.toCollectionName(model.modelName, options);
}

var collectionOptions = {
bufferCommands: s ? s.options.bufferCommands : true
, capped: s && s.options.capped
bufferCommands: s ? options.bufferCommands : true
, capped: s && options.capped
};

Model.prototype.collection = conn.collection(collection, collectionOptions);
Expand Down

0 comments on commit ba3f54f

Please sign in to comment.