Skip to content
Browse files

Added coverage to gitignore

  • Loading branch information...
1 parent a4ca831 commit 477ce11b62a1b0e826d73479185ca3cbd8b9f1a8 @1602 1602 committed Apr 7, 2013
Showing with 10 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +9 −0 lib/mongodb.js
View
1 .gitignore
@@ -1 +1,2 @@
node_modules
+coverage
View
9 lib/mongodb.js
@@ -53,6 +53,11 @@ exports.initialize = function initializeSchema(schema, callback) {
schema.ObjectID = ObjectID;
};
+var MongoObjectID = function ObjectID(id) {
+ if (typeof id !== 'string') return id;
+ return new mongodb.ObjectID(id);
+}
+
function MongoDB(s, schema, callback) {
var i, n;
this.name = 'mongodb';
@@ -98,6 +103,10 @@ MongoDB.prototype.defineProperty = function (model, prop, params) {
this._models[model].properties[prop] = params;
};
+MongoDB.prototype.defineForeignKey = function (model, key, cb) {
+ cb(null, MongoObjectID);
+};
+
MongoDB.prototype.collection = function (name) {
if (!this.collections[name]) {
this.collections[name] = new mongodb.Collection(this.client, name);

0 comments on commit 477ce11

Please sign in to comment.
Something went wrong with that request. Please try again.