Remove the deletion of property type as the instane is shared by the base model class

This commit is contained in:
Raymond Feng 2013-08-15 16:50:50 -07:00
parent d697fb5d4e
commit 29c95a4ec7
1 changed files with 4 additions and 2 deletions

View File

@ -471,9 +471,11 @@ ModelBuilder.prototype.buildSchema = function(name, properties, associations) {
var typeDef = { var typeDef = {
type: type type: type
}; };
delete properties[p].type;
for (var a in properties[p]) { for (var a in properties[p]) {
typeDef[a] = properties[p][a]; // Skip the type property but don't delete it Model.extend() shares same instances of the properties from the base class
if(a !== 'type') {
typeDef[a] = properties[p][a];
}
} }
properties[p] = typeDef; properties[p] = typeDef;
} }