From 34107a6a262995202c351cef59cd09d6c574641e Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 6 Nov 2013 14:00:22 -0800 Subject: [PATCH] Redefine the existing class if it's resolved --- lib/model-builder.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/model-builder.js b/lib/model-builder.js index 99a68f3b..9a935702 100644 --- a/lib/model-builder.js +++ b/lib/model-builder.js @@ -107,7 +107,9 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett // Check if there is a unresolved model with the same name var ModelClass = this.models[className]; - if(!ModelClass) { + // Create the ModelClass if it doesn't exist or it's resolved (override) + // TODO: [rfeng] We need to decide what names to use for built-in models such as User. + if(!ModelClass || !ModelClass.settings.unresolved) { // every class can receive hash of data as optional param ModelClass = function ModelConstructor(data, dataSource) { if(!(this instanceof ModelConstructor)) {