Skip to content

Commit eb6e315

Browse files
committed
Prepare for 3.0.0-rc.3
1 parent 81f5f9a commit eb6e315

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### 3.0.0-rc.3 - 17 October 2016
2+
3+
###### Bug fixes
4+
- Fixed update throwing error when record was unchanged.
5+
16
##### 3.0.0-rc.2 - 23 August 2016
27

38
###### Backwards compatible changes

mocha.start.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*global assert:true */
21
'use strict'
32

43
// prepare environment for js-data-adapter-tests

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-data-rethinkdb",
33
"description": "RethinkDB adapter for js-data.",
4-
"version": "3.0.0-rc.2",
4+
"version": "3.0.0-rc.3",
55
"homepage": "https://github.com/js-data/js-data-rethinkdb",
66
"repository": {
77
"type": "git",
@@ -63,10 +63,10 @@
6363
"mout": "1.0.0"
6464
},
6565
"peerDependencies": {
66-
"js-data": "^3.0.0-rc.4",
66+
"js-data": "^3.0.0-rc.6",
6767
"rethinkdbdash": ">=2.0.0"
6868
},
6969
"devDependencies": {
70-
"js-data-repo-tools": "0.5.6"
70+
"js-data-repo-tools": "0.5.7"
7171
}
7272
}

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,14 @@ Adapter.extend({
414414
.update(props, updateOpts)
415415
.run(this.getOpt('runOpts', opts))
416416
.then((cursor) => {
417-
let record
418417
this._handleErrors(cursor)
419-
if (cursor && cursor.changes && cursor.changes.length && cursor.changes[0].new_val) {
420-
record = cursor.changes[0].new_val
421-
} else {
418+
if (cursor.skipped) {
422419
throw new Error('Not Found')
420+
} else if (cursor && cursor.changes && cursor.changes.length && cursor.changes[0].new_val) {
421+
return [cursor.changes[0].new_val, cursor]
422+
} else {
423+
return this._find(mapper, id, opts)
423424
}
424-
return [record, cursor]
425425
})
426426
},
427427

0 commit comments

Comments
 (0)