forked from sequelize/sequelize
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sequelize#1624 from seegno/fix-bulk-operations-result
Change bulkUpdate to return the affected rows
- Loading branch information
Showing
9 changed files
with
192 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,7 +260,7 @@ if (dialect.match(/^postgres/)) { | |
.create({ username: 'user', email: ['[email protected]'], settings: { created: { test: '"value"' }}}) | ||
.success(function(newUser) { | ||
// Check to see if the default value for an hstore field works | ||
expect(newUser.document).to.deep.equal({default: 'value'}) | ||
expect(newUser.document).to.deep.equal({ default: 'value' }) | ||
expect(newUser.settings).to.deep.equal({ created: { test: '"value"' }}) | ||
|
||
// Check to see if updating an hstore field works | ||
|
@@ -295,6 +295,22 @@ if (dialect.match(/^postgres/)) { | |
.error(console.log) | ||
}) | ||
|
||
it("should update hstore correctly and return the affected rows", function(done) { | ||
var self = this | ||
|
||
this.User | ||
.create({ username: 'user', email: ['[email protected]'], settings: { created: { test: '"value"' }}}) | ||
.success(function(oldUser) { | ||
// Update the user and check that the returned object's fields have been parsed by the hstore library | ||
self.User.update({settings: {should: 'update', to: 'this', first: 'place'}}, oldUser.identifiers, { returning: true }).spread(function(count, users) { | ||
expect(count).to.equal(1); | ||
expect(users[0].settings).to.deep.equal({should: 'update', to: 'this', first: 'place'}) | ||
done() | ||
}) | ||
}) | ||
.error(console.log) | ||
}) | ||
|
||
it("should read hstore correctly", function(done) { | ||
var self = this | ||
var data = { username: 'user', email: ['[email protected]'], settings: { created: { test: '"value"' }}} | ||
|
Oops, something went wrong.