diff --git a/lib/abstract-class.js b/lib/abstract-class.js index d6fc8e0e..b0cf1655 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -60,9 +60,9 @@ AbstractClass.prototype._initProperties = function (data, applySetters) { )) }); - if (properties[attr].type.name === 'JSON' && typeof this[_attr] === 'string') { + if (properties[attr].type.name === 'JSON' && this[_attr]) { try { - this[_attr] = JSON.parse(this[_attr]); + this[_attr] = JSON.parse(this[_attr] + ''); } catch (e) { } } diff --git a/package.json b/package.json index e1144f49..ffdfc967 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "redis": ">= 0.6.7", "mongoose": ">= 2.2.3", "mysql": ">= 0.9.4", - "pg": ">= 0.6.9", + "pg": "latest", "sqlite3": ">= 2.0.18", "riak-js": ">= 0.4.1", "neo4j": ">= 0.2.5",