Comparing version 0.1.1 to 0.1.2
@@ -156,3 +156,6 @@ !function(){ | ||
else { | ||
connection.commit(callback); | ||
connection.commit(function(err){ | ||
if (err) callback(err); | ||
else callback(null, this); | ||
}.bind(this)); | ||
} | ||
@@ -178,3 +181,3 @@ }.bind(this)); | ||
this._saveChildren(connection, noReload, function(err){ | ||
/*this._saveChildren(connection, noReload, function(err){ | ||
if (err) callback(err); | ||
@@ -184,3 +187,3 @@ else { | ||
} | ||
}.bind(this)); | ||
}.bind(this));*/ | ||
@@ -201,3 +204,3 @@ | ||
else { | ||
this._orm.getDatabase().query('insert', query, function(err, result){ | ||
this._orm.getDatabase().query('insert', query, function(err, result){ log(err); | ||
if (err) callback(err); | ||
@@ -209,3 +212,3 @@ else { | ||
this[this._defintion.primaryKeys[0]] = result.id; | ||
if (noReload) this.reload(callback); | ||
if (!noReload) this.reload(callback); | ||
else callback(null, this); | ||
@@ -212,0 +215,0 @@ } |
@@ -150,2 +150,3 @@ !function(){ | ||
CustomModel.getOrm = options.getOrm; | ||
@@ -152,0 +153,0 @@ // build model |
@@ -15,3 +15,4 @@ !function(){ | ||
, Functions = require('./Functions') | ||
, staticORM = new (require('./StaticORM'))(); | ||
, StaticORM = require('./StaticORM') | ||
, staticORM; | ||
@@ -240,7 +241,10 @@ | ||
ORM.__proto__ = staticORM; | ||
staticORM = new StaticORM(); | ||
Object.keys(Object.getPrototypeOf(staticORM)).forEach(function(key){ | ||
if(!ORM[key]) ORM[key] = staticORM[key]; | ||
}); | ||
module.exports = ORM; | ||
}(); |
@@ -43,4 +43,7 @@ !function(){ | ||
// execute queries | ||
this._executeSubqueries(resource, queries, callback); | ||
if (queries && queries.length) { | ||
// execute queries | ||
this._executeSubqueries(resource, queries, callback); | ||
} | ||
else callback(null, resource.set); | ||
} | ||
@@ -47,0 +50,0 @@ else callback(null, resource.set); |
{ | ||
"name" : "ee-orm" | ||
, "description" : "a simple yet powerful javascript orm for node.js" | ||
, "version" : "0.1.1" | ||
, "version" : "0.1.2" | ||
, "homepage" : "https://github.com/eventEmitter/ee-orm" | ||
@@ -34,2 +34,3 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" | ||
, "ee-travis" : "*" | ||
, "ee-mysql-connection" : "*" | ||
} | ||
@@ -36,0 +37,0 @@ , "optionalDependencies": {} |
@@ -23,3 +23,3 @@ | ||
log.wtf('hui'); | ||
/** | ||
@@ -26,0 +26,0 @@ // insert 1000 roles |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65914
1825
3