Removed unused experimental stuff
This commit is contained in:
parent
cddb24ec84
commit
5b33c2a0f1
|
@ -133,7 +133,7 @@ AbstractClass.whatTypeName = function (propName) {
|
|||
AbstractClass._forDB = function (data) {
|
||||
var res = {};
|
||||
Object.keys(data).forEach(function (propName) {
|
||||
if (this.whatTypeName(propName) === 'JSON' || data[propName] instanceof Array) {
|
||||
if (this.whatTypeName(propName) === 'JSON') {
|
||||
res[propName] = JSON.stringify(data[propName]);
|
||||
} else {
|
||||
res[propName] = data[propName];
|
||||
|
|
|
@ -242,6 +242,9 @@ Schema.prototype.define = function defineClass(className, properties, settings)
|
|||
|
||||
return NewClass;
|
||||
|
||||
|
||||
};
|
||||
|
||||
function standartize(properties, settings) {
|
||||
Object.keys(properties).forEach(function (key) {
|
||||
var v = properties[key];
|
||||
|
@ -257,9 +260,6 @@ Schema.prototype.define = function defineClass(className, properties, settings)
|
|||
// or {timestamps: {created: 'created_at', updated: false}}
|
||||
// by default property names: createdAt, updatedAt
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Define single property named `prop` on `model`
|
||||
*
|
||||
|
@ -300,11 +300,9 @@ Schema.prototype.defineProperty = function (model, prop, params) {
|
|||
*/
|
||||
Schema.prototype.extendModel = function (model, props) {
|
||||
var t = this;
|
||||
standartize(props, {});
|
||||
Object.keys(props).forEach(function (propName) {
|
||||
var definition = props[propName];
|
||||
if (typeof definition === 'function' || typeof definition !== 'object') {
|
||||
definition = {type: definition};
|
||||
}
|
||||
t.defineProperty(model, propName, definition);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue