vendor/components/indefinido-indemma/build/release.js in ende-0.4.20 vs vendor/components/indefinido-indemma/build/release.js in ende-0.4.21
- old
+ new
@@ -20877,11 +20877,15 @@
if (data == null) {
data = {};
}
old_route = this.route;
- default_route = "/" + (model.pluralize(this.resource.name));
+ default_route = '/';
+ if (this.resource.scope != null) {
+ default_route += this.resource.scope + '/';
+ }
+ default_route += this.resource.singular ? this.resource.name : model.pluralize(this.resource.name);
if (default_route !== this.route) {
this.route = default_route;
}
if (action) {
Object.defineProperty(this, 'route', {
@@ -20938,12 +20942,13 @@
var association, association_attributes, association_name, associations_attributes, attribute, message, name, singular_resource, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _results;
_ref = model[this.resource.toString()].has_many;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
association_name = _ref[_i];
- associations_attributes = attributes[association_name];
+ associations_attributes = attributes[association_name + "_attributes"] || attributes[association_name];
delete attributes[association_name];
+ delete attributes[association_name + '_attributes'];
association = this[association_name];
if (association == null) {
message = "Association '" + association_name + "' not found. \n";
message += "For record with resource " + this.resource + ". \n";
message += "Probably defined on server side but not on client side.\n";
@@ -22032,11 +22037,11 @@
return validation;
},
validate: function(doned, failed) {
var results, validator, _i, _len, _ref;
- if (this.validated && !this.dirty) {
+ if (this.validated) {
return this.validation;
}
this.errors.clear();
results = [this];
_ref = model[this.resource.toString()].validators;
@@ -22051,10 +22056,10 @@
var old_dirty;
old_dirty = record.dirty;
record.dirty = null;
record.validated || (record.validated = true);
- record.dirty = old_dirty;
+ record.observed.dirty = old_dirty;
return record;
});
}
}
};