Comparing version 1.5.1 to 1.5.2
@@ -40,2 +40,4 @@ // General storage interface. | ||
modelfunc.prototype.keyfield = keyfield; | ||
_.assign(modelfunc, persist.statics); | ||
@@ -42,0 +44,0 @@ _.assign(modelfunc.prototype, persist.plugins); |
{ | ||
"name": "polyclay", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "a schema-enforcing model class for node with optional key-value store persistence", | ||
@@ -5,0 +5,0 @@ "author": "C J Silverio <ceejceej@gmail.com>", |
@@ -138,2 +138,19 @@ /*global describe:true, it:true, before:true, after:true */ | ||
it('stores the name of the key field on the prototype', function() | ||
{ | ||
var Ephemeral = polyclay.Model.buildClass( | ||
{ | ||
properties: | ||
{ | ||
'id': 'string' | ||
} | ||
}); | ||
polyclay.persist(Ephemeral, 'id'); | ||
var obj = new Ephemeral(); | ||
obj.should.have.property('keyfield'); | ||
obj.keyfield.should.be.a('string'); | ||
assert(obj.keyfield === 'id', 'keyfield property not on object!'); | ||
}); | ||
it('throws when passed a model without polyclay attributes', function() | ||
@@ -140,0 +157,0 @@ { |
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
79455
1729