Comparing version 1.5.2 to 1.5.3
@@ -39,2 +39,4 @@ // General storage interface. | ||
} | ||
else | ||
keyfield = 'key'; | ||
@@ -41,0 +43,0 @@ modelfunc.prototype.keyfield = keyfield; |
{ | ||
"name": "polyclay", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"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>", |
@@ -155,2 +155,19 @@ /*global describe:true, it:true, before:true, after:true */ | ||
it('defaults the key field name to `key` when none is provided', function() | ||
{ | ||
var Ephemeral = polyclay.Model.buildClass( | ||
{ | ||
properties: | ||
{ | ||
'key': 'string' | ||
} | ||
}); | ||
polyclay.persist(Ephemeral); | ||
var obj = new Ephemeral(); | ||
obj.should.have.property('keyfield'); | ||
obj.keyfield.should.be.a('string'); | ||
assert(obj.keyfield === 'key', 'keyfield property is not `key`!'); | ||
}); | ||
it('throws when passed a model without polyclay attributes', function() | ||
@@ -157,0 +174,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
79875
1746