From 2070462e7c8fa6aa8faf4fd3c2732606d7246884 Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Wed, 4 Dec 2013 00:45:30 +0200 Subject: [PATCH] Added list of preprocessors to Database --- lib/Database.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Database.js b/lib/Database.js index 2466ea3..fc05491 100644 --- a/lib/Database.js +++ b/lib/Database.js @@ -5,6 +5,7 @@ var MongoClient = require('mongodb').MongoClient; var Model = require('./Model'); var Instance = require('./Instance'); +var _ = require('lodash'); (require.modules || {}).Database = module.exports = Database; @@ -29,6 +30,13 @@ function Database(config) { Database.Model = Model; Database.Instance = Instance; +// Add preprocessor accessors +var preprocessors = require('./preprocessors'); +for(var k in preprocessors) { + Database[k] = preprocessors[k]; +} + + Database.prototype.connect = function (cb) { /// Connects to the database server specified in the provided configuration /// A function to be called when the connection is completed, called immediately if one is already open