Skip to content

Commit

Permalink
Closes #242 Create alias' for session stores(e.g., 'mongo' for 'mongo…
Browse files Browse the repository at this point in the history
…db'). And removed an unused value in the engine for templates.
  • Loading branch information
larzconwell committed Oct 25, 2012
1 parent 2e8e3fb commit 77e79ea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions lib/sessions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,19 @@ var session = new (function () {
this.store = null;

this.createStore = function (type, callback) {
var key = geddy.string.capitalize(type);
var constructor = require('./stores/' + type)[key];
var key
, constructor;

if (type === 'mongo') {
type = 'mongodb';
}
if (type === 'couch') {
type = 'couchdb';
}

key = geddy.string.capitalize(type);
constructor = require('./stores/' + type)[key];

session.store = new constructor(callback);
};

Expand Down
4 changes: 2 additions & 2 deletions lib/template/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Templater.prototype.eventTypes = {
Templater.prototype.render = function (data, config) {
var templateFileName;

// Register all the helper functions to Templato
geddy.viewHelpers.registerData(data); // Enables access to the current params for `urlFor`
// Register data to helpers, and register the helpers to the adapter
geddy.viewHelpers.registerData(data);
Adapter.registerHelpers(geddy.viewHelpers);

// Rendering a template in a layout
Expand Down
2 changes: 1 addition & 1 deletion lib/template/template_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

var fs = require('fs')
, path = require('path')
, engine = {cache: {}, compiledCache: {}};
, engine = {cache: {}};

engine.TemplateNode = function (id, data, params, parentNode, adapter) {
this.id = id;
Expand Down

0 comments on commit 77e79ea

Please sign in to comment.