不要怂,就是干,撸起袖子干!

You need to sign in or sign up before continuing.
Commit 8ecc3085 by Mick Hansen

change transaction docs

1 parent d01ce9b1
Showing with 7 additions and 10 deletions
...@@ -5,4 +5,4 @@ README.md ...@@ -5,4 +5,4 @@ README.md
.watchr.js .watchr.js
changelog.md changelog.md
Makefile Makefile
coverage* coverage*
\ No newline at end of file
...@@ -721,16 +721,12 @@ module.exports = (function() { ...@@ -721,16 +721,12 @@ module.exports = (function() {
* Start a transaction. When using transactions, you should pass the transaction in the options argument in order for the query to happen under that transaction * Start a transaction. When using transactions, you should pass the transaction in the options argument in order for the query to happen under that transaction
* *
* ```js * ```js
* sequelize.transaction(function(t) { * sequelize.transaction().then(function (t) {
* User.find(..., { transaction: t}).success(function (user) { * return User.find(..., { transaction: t}).then(function (user) {
* user.updateAttributes(..., { transaction: t}).success(function () { * return user.updateAttributes(..., { transaction: t});
* t.commit()
* })
* })
*
* // the commit / rollback will emit events which can be observed via:
* t.done(function() {
* }) * })
* .then(t.commit.bind(t))
* .catch(t.rollback.bind(t));
* }) * })
* ``` * ```
* *
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!