Comparing version 0.2.0 to 0.2.1
@@ -0,1 +1,2 @@ | ||
/*jshint camelcase:false */ | ||
/** | ||
@@ -20,13 +21,17 @@ * @fileOverview The bare CRUD command implementations | ||
var ent; | ||
if (typeof Entity === 'function' && Entity.prototype) { | ||
if (Entity.getInstance) { | ||
ent = Entity.getInstance(); | ||
/** @type {Entity} An instance of Entity with CRUD methods */ | ||
this.__defineGetter__('entity', function() { | ||
if (ent) { return ent; } | ||
if (typeof Entity === 'function' && Entity.prototype) { | ||
if (Entity.getInstance) { | ||
ent = Entity.getInstance(); | ||
} else { | ||
ent = new Entity(); | ||
} | ||
} else { | ||
ent = new Entity(); | ||
ent = Entity; | ||
} | ||
} else { | ||
ent = Entity; | ||
} | ||
/** @type {Entity} An instance of Entity with CRUD methods */ | ||
this.entity = ent; | ||
return ent; | ||
}); | ||
@@ -89,5 +94,3 @@ // prep pagination | ||
var rdrUrl = this.getBaseUrl(req) + '/add'; | ||
var entity = new this.Entity(req.user); | ||
return entity.create(req.body) | ||
return this.entity.create(req.body) | ||
.then(this._handleCreate.bind(this, req, res)) | ||
@@ -94,0 +97,0 @@ .catch(this.handleError.bind(this, req, res, rdrUrl)); |
{ | ||
"name": "crude", | ||
"description": "Seamless CRUD control operations for node.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/talksession/node-crude", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -32,2 +32,4 @@ # node-crude | ||
## Release History | ||
- **v0.2.1**, *17 Feb 2014* | ||
- Lazy instantiate Entities. | ||
- **v0.2.0**, *17 Feb 2014* | ||
@@ -34,0 +36,0 @@ - Upgrade to 0.2.1 Entity and Cip packages. |
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
29731
727
60