js-data-rethinkdb
Advanced tools
Comparing version 3.0.0-alpha.10 to 3.0.0-alpha.11
@@ -0,1 +1,7 @@ | ||
##### 3.0.0-alpha.11 - 06 March 2016 | ||
###### Backwards compatible bug fixes | ||
- create() now makes us of withoutRelations() | ||
- More use of Adapter#respond() more consistent | ||
##### 3.0.0-alpha.10 - 06 March 2016 | ||
@@ -2,0 +8,0 @@ |
@@ -479,3 +479,4 @@ 'use strict'; | ||
insertOpts.returnChanges = true; | ||
return self.selectTable(mapper, opts).insert(props, insertOpts).run(self.getOpt('runOpts', opts)); | ||
_props = withoutRelations(mapper, props); | ||
return self.selectTable(mapper, opts).insert(_props, insertOpts).run(self.getOpt('runOpts', opts)); | ||
}).then(function (cursor) { | ||
@@ -542,11 +543,11 @@ self._handleErrors(cursor); | ||
} | ||
var result = new Adapter.Response(records, cursor, 'createMany'); | ||
result.created = records.length; | ||
result = self.getOpt('raw', opts) ? result : result.data; | ||
var response = new Adapter.Response(records, cursor, 'createMany'); | ||
response.created = records.length; | ||
response = self.respond(response, opts); | ||
// afterCreateMany lifecycle hook | ||
op = opts.op = 'afterCreateMany'; | ||
return resolve(self[op](mapper, props, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, props, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -585,10 +586,10 @@ }); | ||
}).then(function (cursor) { | ||
var result = new Adapter.Response(undefined, cursor, 'destroy'); | ||
result = self.getOpt('raw', opts) ? result : undefined; | ||
var response = new Adapter.Response(undefined, cursor, 'destroy'); | ||
response = self.respond(response, opts); | ||
// afterDestroy lifecycle hook | ||
op = opts.op = 'afterDestroy'; | ||
return resolve(self[op](mapper, id, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, id, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -636,10 +637,10 @@ }); | ||
}).then(function (cursor) { | ||
var result = new Adapter.Response(undefined, cursor, 'destroyAll'); | ||
result = self.getOpt('raw', opts) ? result : undefined; | ||
var response = new Adapter.Response(undefined, cursor, 'destroyAll'); | ||
response = self.respond(response, opts); | ||
// afterDestroyAll lifecycle hook | ||
op = opts.op = 'afterDestroyAll'; | ||
return resolve(self[op](mapper, query, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, query, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -745,11 +746,11 @@ }); | ||
}).then(function () { | ||
var result = new Adapter.Response(record, {}, 'find'); | ||
result.found = record ? 1 : 0; | ||
result = self.getOpt('raw', opts) ? result : result.data; | ||
var response = new Adapter.Response(record, {}, 'find'); | ||
response.found = record ? 1 : 0; | ||
response = self.respond(response, opts); | ||
// afterFind lifecycle hook | ||
op = opts.op = 'afterFind'; | ||
return resolve(self[op](mapper, id, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, id, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -887,11 +888,11 @@ }); | ||
records || (records = []); | ||
var result = new Adapter.Response(records, {}, 'findAll'); | ||
result.found = records.length; | ||
result = self.getOpt('raw', opts) ? result : result.data; | ||
var response = new Adapter.Response(records, {}, 'findAll'); | ||
response.found = records.length; | ||
response = self.respond(response, opts); | ||
// afterFindAll lifecycle hook | ||
op = opts.op = 'afterFindAll'; | ||
return resolve(self[op](mapper, query, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, query, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -961,11 +962,11 @@ }); | ||
} | ||
var result = new Adapter.Response(record, cursor, 'update'); | ||
result.updated = 1; | ||
result = self.getOpt('raw', opts) ? result : result.data; | ||
var response = new Adapter.Response(record, cursor, 'update'); | ||
response.updated = 1; | ||
response = self.respond(response, opts); | ||
// afterUpdate lifecycle hook | ||
op = opts.op = 'afterUpdate'; | ||
return resolve(self[op](mapper, id, props, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, id, props, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -1024,11 +1025,11 @@ }); | ||
} | ||
var result = new Adapter.Response(records, cursor, 'update'); | ||
result.updated = records.length; | ||
result = self.getOpt('raw', opts) ? result : result.data; | ||
var response = new Adapter.Response(records, cursor, 'update'); | ||
response.updated = records.length; | ||
response = self.respond(response, opts); | ||
// afterUpdateAll lifecycle hook | ||
op = opts.op = 'afterUpdateAll'; | ||
return resolve(self[op](mapper, props, query, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, props, query, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -1086,11 +1087,11 @@ }); | ||
} | ||
var result = new Adapter.Response(updatedRecords || [], cursor, 'update'); | ||
result.updated = result.data.length; | ||
result = self.getOpt('raw', opts) ? result : result.data; | ||
var response = new Adapter.Response(updatedRecords || [], cursor, 'update'); | ||
response.updated = response.data.length; | ||
response = self.respond(response, opts); | ||
// afterUpdateMany lifecycle hook | ||
op = opts.op = 'afterUpdateMany'; | ||
return resolve(self[op](mapper, records, opts, result)).then(function (_result) { | ||
return resolve(self[op](mapper, records, opts, response)).then(function (_response) { | ||
// Allow for re-assignment from lifecycle hook | ||
return isUndefined(_result) ? result : _result; | ||
return isUndefined(_response) ? response : _response; | ||
}); | ||
@@ -1097,0 +1098,0 @@ }); |
{ | ||
"name": "js-data-rethinkdb", | ||
"description": "RethinkDB adapter for js-data.", | ||
"version": "3.0.0-alpha.10", | ||
"version": "3.0.0-alpha.11", | ||
"homepage": "https://github.com/js-data/js-data-rethinkdb", | ||
@@ -6,0 +6,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
119828
1128