Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Oct 17, 2016
2 parents f61cbe5 + eb6e315 commit bc0afb3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 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-rc.3 - 17 October 2016

###### Bug fixes
- Fixed update throwing error when record was unchanged.

##### 3.0.0-rc.2 - 23 August 2016

###### Backwards compatible changes
Expand Down
1 change: 0 additions & 1 deletion mocha.start.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global assert:true */
'use strict'

// prepare environment for js-data-adapter-tests
Expand Down
6 changes: 3 additions & 3 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-rc.2",
"version": "3.0.0-rc.3",
"homepage": "https://github.com/js-data/js-data-rethinkdb",
"repository": {
"type": "git",
Expand Down Expand Up @@ -63,10 +63,10 @@
"mout": "1.0.0"
},
"peerDependencies": {
"js-data": "^3.0.0-rc.4",
"js-data": "^3.0.0-rc.6",
"rethinkdbdash": ">=2.0.0"
},
"devDependencies": {
"js-data-repo-tools": "0.5.6"
"js-data-repo-tools": "0.5.7"
}
}
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,14 @@ Adapter.extend({
.update(props, updateOpts)
.run(this.getOpt('runOpts', opts))
.then((cursor) => {
let record
this._handleErrors(cursor)
if (cursor && cursor.changes && cursor.changes.length && cursor.changes[0].new_val) {
record = cursor.changes[0].new_val
} else {
if (cursor.skipped) {
throw new Error('Not Found')
} else if (cursor && cursor.changes && cursor.changes.length && cursor.changes[0].new_val) {
return [cursor.changes[0].new_val, cursor]
} else {
return this._find(mapper, id, opts)
}
return [record, cursor]
})
},

Expand Down

0 comments on commit bc0afb3

Please sign in to comment.