Comparing version 0.1.6 to 0.1.7
@@ -37,3 +37,3 @@ !function(){ | ||
this._setProrperty('_relatingSets', options.relatingSets); | ||
this._setProrperty('_fromDb', options.isFromDB || false); | ||
@@ -113,3 +113,3 @@ | ||
, isFromDatabase: function(){ | ||
return this._fromDb; | ||
return this._fromDb; | ||
} | ||
@@ -187,3 +187,3 @@ | ||
else callback(err); | ||
}.bind(this)); | ||
}.bind(this)); | ||
} | ||
@@ -262,3 +262,3 @@ else { | ||
else callback(err); | ||
}.bind(this)); | ||
}.bind(this)); | ||
} | ||
@@ -271,3 +271,3 @@ else { | ||
} | ||
}.bind(this)); | ||
}.bind(this)); | ||
} | ||
@@ -313,3 +313,3 @@ }.bind(this)); | ||
else { | ||
connection.query('insert', query, function(err, result){ | ||
connection.query('insert', query, function(err, result){ | ||
if (err) callback(err); | ||
@@ -319,8 +319,11 @@ else { | ||
// reload | ||
if (this._defintion.primaryKeys.length === 1){ | ||
this[this._defintion.primaryKeys[0]] = result.id; | ||
if (!noReload) this.reload(callback, connection); | ||
else callback(null, this); | ||
if(result.id) { | ||
if (this._defintion.primaryKeys.length === 1){ | ||
this[this._defintion.primaryKeys[0]] = result.id; | ||
} | ||
else throw new Error('Cannot load record with more than one primarykey!'); | ||
} | ||
else throw new Error('Cannot load record with more than one primarykey!'); | ||
if (!noReload) this.reload(callback, connection); | ||
else callback(null, this); | ||
} | ||
@@ -347,3 +350,3 @@ else throw new Error('not implemented!'); | ||
value.findOne(function(err, model) { | ||
value.findOne(function(err, model) { | ||
if (err) next(err); | ||
@@ -350,0 +353,0 @@ else if (model) { |
{ | ||
"name" : "ee-orm" | ||
, "description" : "a simple yet powerful javascript orm for node.js" | ||
, "version" : "0.1.6" | ||
, "version" : "0.1.7" | ||
, "homepage" : "https://github.com/eventEmitter/ee-orm" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
78140
2201
0