If property is array (List) need to convert it to JSON

This commit is contained in:
Anatoliy Chakkaev 2013-02-10 04:53:05 +08:00
parent 412a46d603
commit 734ab8abd1
1 changed files with 1 additions and 1 deletions

View File

@ -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') {
if (this.whatTypeName(propName) === 'JSON' || data[propName] instanceof Array) {
res[propName] = JSON.stringify(data[propName]);
} else {
res[propName] = data[propName];