Skip to content

Commit

Permalink
3.0.0-alpha.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Feb 27, 2016
1 parent 6b6ed72 commit 9ab69c3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### 3.0.0-alpha.2 - 26 February 2016

###### Backwards compatible bug fixes
- Fixed edge case with returnDeletedIds

##### 3.0.0-alpha.1 - 26 February 2016

###### Breaking API changes
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
# Names should be added to this file as:
# [commit count] Name <email address>
1 InternalFX <bryan@internalfx.com>
39 Jason Dobry <jason.dobry@gmail.com>
43 Jason Dobry <jason.dobry@gmail.com>
2 Ollie Relph <ollie@relph.me>
6 changes: 3 additions & 3 deletions dist/js-data-rethinkdb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js-data-rethinkdb.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-data-rethinkdb",
"description": "RethinkDB adapter for js-data.",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"homepage": "https://github.com/js-data/js-data-rethinkdb",
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,7 +59,7 @@
"babel-preset-stage-0": "6.5.0",
"chai": "3.5.0",
"codacy-coverage": "1.1.3",
"coveralls": "2.11.6",
"coveralls": "2.11.8",
"ink-docstrap": "1.1.2",
"istanbul": "0.4.2",
"js-data-adapter-tests": "^2.0.0-alpha.7",
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,17 @@ addHiddenPropsToTarget(RethinkDBAdapter.prototype, {
return self.selectTable(mapper, opts).get(id).delete().run()
}).then(function (cursor) {
let deleted = 0
if (cursor && cursor.deleted) {
if (cursor && cursor.deleted && returnDeletedIds) {
deleted = cursor.deleted
}
// afterDestroy lifecycle hook
op = opts.op = 'afterDestroy'
return resolve(self[op](mapper, id, opts, deleted ? id : undefined)).then(function (_id) {
// Allow for re-assignment from lifecycle hook
id = isUndefined(_id) && returnDeletedIds ? id : _id
id = isUndefined(_id) && deleted ? id : _id
const result = {}
fillIn(result, cursor)
result.data = deleted ? id : undefined
result.data = id
return self.getRaw(opts) ? result : result.data
})
})
Expand Down

0 comments on commit 9ab69c3

Please sign in to comment.