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

Commit 8ecc3085 by Mick Hansen

change transaction docs

1 parent d01ce9b1
Showing with 7 additions and 10 deletions
......@@ -5,4 +5,4 @@ README.md
.watchr.js
changelog.md
Makefile
coverage*
coverage*
\ No newline at end of file
......@@ -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
*
* ```js
* sequelize.transaction(function(t) {
* User.find(..., { transaction: t}).success(function (user) {
* user.updateAttributes(..., { transaction: t}).success(function () {
* t.commit()
* })
* })
*
* // the commit / rollback will emit events which can be observed via:
* t.done(function() {
* sequelize.transaction().then(function (t) {
* return User.find(..., { transaction: t}).then(function (user) {
* return user.updateAttributes(..., { transaction: t});
* })
* .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!