Skip to content

Commit

Permalink
More cleanup for #1351, fix #1416
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 15, 2014
1 parent 8bd2b2e commit 3afccde
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/model.js
Expand Up @@ -2678,7 +2678,6 @@ Model.compile = function compile (name, schema, collectionName, connection, base
}

model.schema = model.prototype.schema;
model.options = model.prototype.options;
model.collection = model.prototype.collection;

return model;
Expand Down
1 change: 0 additions & 1 deletion lib/schema.js
Expand Up @@ -292,7 +292,6 @@ reserved.init =
reserved.isNew =
reserved.errors =
reserved.schema =
reserved.options =
reserved.modelName =
reserved.collection =
reserved.toObject =
Expand Down
7 changes: 5 additions & 2 deletions test/query.middleware.test.js
Expand Up @@ -13,7 +13,8 @@ describe('query middleware', function() {
schema = new Schema({
title: String,
author: String,
publisher: { type: Schema.ObjectId, ref: 'gh-2138-1' }
publisher: { type: Schema.ObjectId, ref: 'gh-2138-1' },
options: String
});

var publisherSchema = new Schema({
Expand Down Expand Up @@ -42,7 +43,8 @@ describe('query middleware', function() {
var doc = {
title: 'Professional AngularJS',
author: 'Val',
publisher: publisher._id
publisher: publisher._id,
options: 'bacon'
};

Author.create(doc, function(error) {
Expand Down Expand Up @@ -78,6 +80,7 @@ describe('query middleware', function() {
schema.post('find', function(results, next) {
assert.equal(1, results.length);
assert.equal('Val', results[0].author);
assert.equal('bacon', results[0].options);
++postCount;
next();
});
Expand Down
6 changes: 0 additions & 6 deletions test/schema.test.js
Expand Up @@ -1312,12 +1312,6 @@ describe('schema', function(){
});
}, /`on` may not be used as a schema pathname/);

assert.throws(function(){
new Schema({
options: String
});
}, /`options` may not be used as a schema pathname/);

assert.throws(function(){
new Schema({
collection: String
Expand Down

0 comments on commit 3afccde

Please sign in to comment.