From 6b5acbfb08a4d5df6aa93043cc034a2b66dc2254 Mon Sep 17 00:00:00 2001 From: Matias Lahti Date: Mon, 9 Jun 2014 15:56:22 +0300 Subject: [PATCH] add reference to default adapter on creation of model if it doesnt have an adapter already --- lib/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/index.js b/lib/index.js index 5d0ed90c..571c4d30 100644 --- a/lib/index.js +++ b/lib/index.js @@ -636,6 +636,10 @@ utils.mixin(model, new (function () { // Preserve any inherited shit from the definition proto utils.enhance(ModelCtor.prototype, origProto); + // Set the model adapter to the defaultadapter in case there is none + if (!ModelCtor.adapter) + ModelCtor.adapter = this.defaultAdapter + model[name] = ModelCtor; return ModelCtor;