js-core-data
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -20,3 +20,3 @@ // Generated by CoffeeScript 1.10.0 | ||
return this.entitiesChanges.push({ | ||
entity: name, | ||
entity: this._entityName(name), | ||
change: '+' | ||
@@ -28,4 +28,4 @@ }); | ||
return this.entitiesChanges.push({ | ||
entity: oldName, | ||
change: newName | ||
entity: this._entityName(oldName), | ||
change: this._entityName(newName) | ||
}); | ||
@@ -36,3 +36,3 @@ }; | ||
return this.entitiesChanges.push({ | ||
entity: name, | ||
entity: this._entityName(name), | ||
change: '-' | ||
@@ -39,0 +39,0 @@ }); |
@@ -342,3 +342,16 @@ // Generated by CoffeeScript 1.10.0 | ||
ManagedObject.prototype.willSave = function() {}; | ||
ManagedObject.prototype.willSave = function() { | ||
var attribute, i, len, ref, results; | ||
ref = this.entity.getNonTransientAttributes(); | ||
results = []; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
attribute = ref[i]; | ||
if (attribute.info.required && this[attribute.name] === null) { | ||
throw new Error('cannot save ' + this.entity.name + ', attribute ' + attribute.name + ' is required'); | ||
} else { | ||
results.push(void 0); | ||
} | ||
} | ||
return results; | ||
}; | ||
@@ -345,0 +358,0 @@ ManagedObject.prototype.didSave = function() {}; |
{ | ||
"name": "js-core-data", | ||
"description": "ORM inspired by Apple's Objective-C CoreData", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
499211
99
7631