Comparing version 0.5.4 to 0.5.5
@@ -64,6 +64,7 @@ // Generated by CoffeeScript 1.6.2 | ||
Query.prototype.select = function(columns) { | ||
var schema_columns, select; | ||
var intermediate_paths, schema_columns, select; | ||
this._options.select = null; | ||
schema_columns = Object.keys(this._model._schema); | ||
intermediate_paths = this._model._intermediate_paths; | ||
if (typeof columns === 'string') { | ||
@@ -74,3 +75,3 @@ select = []; | ||
return select.push(column); | ||
} else { | ||
} else if (intermediate_paths[column]) { | ||
column += '.'; | ||
@@ -225,3 +226,3 @@ return schema_columns.forEach(function(sc) { | ||
Query.prototype._validateAndBuildSaveData = function(errors, data, updates, path, object) { | ||
var column, error, model, property, schema, _results; | ||
var column, error, model, property, schema, temp, _results; | ||
@@ -241,2 +242,11 @@ model = this._model; | ||
_results.push(model._buildSaveDataColumn(data, updates, path + column, property, true)); | ||
} else if (!object[column] && model._intermediate_paths[column]) { | ||
column += '.'; | ||
temp = {}; | ||
Object.keys(schema).forEach(function(sc) { | ||
if (sc.indexOf(column) === 0) { | ||
return temp[sc.substr(column.length)] = null; | ||
} | ||
}); | ||
_results.push(this._validateAndBuildSaveData(errors, data, updates, path + column, temp)); | ||
} else if (typeof object[column] === 'object') { | ||
@@ -243,0 +253,0 @@ _results.push(this._validateAndBuildSaveData(errors, data, updates, path + column + '.', object[column])); |
{ | ||
"name": "cormo", | ||
"description": "ORM framework for Node.js", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "orm", |
180388
4704