Permalink
Browse files

make setting a models adapter easier

  • Loading branch information...
1 parent fa57fa4 commit effeb10ab421f10df3061e33e3c882e1510dedc6 @nlf nlf committed Oct 6, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/index.js
View
@@ -751,6 +751,11 @@ model.ModelDefinitionBase = function (name) {
this.name = name;
+ this.adapter = function (adapter) {
+ var Adapter = require('./adapters/' + adapters.getAdapterInfo(adapter).filePath).Adapter;
+ model.adapters[name] = new Adapter();
+ };
+
this.property = function (name, datatype, o) {
reg[this.name].properties[name] =
new model.PropertyDescription(name, datatype, o);

0 comments on commit effeb10

Please sign in to comment.