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

Commit 5d2663d7 by Mick Hansen

[ci skip] Transaction documentation errors

1 parent f8431ac4
Showing with 4 additions and 5 deletions
...@@ -6,7 +6,7 @@ The key difference is that the managed transaction uses a callback that expects ...@@ -6,7 +6,7 @@ The key difference is that the managed transaction uses a callback that expects
### Auto commit/rollback ### Auto commit/rollback
```js ```js
return sequelize.transaction(t) { return sequelize.transaction(function (t) {
return User.create({ return User.create({
firstName: 'Abraham', firstName: 'Abraham',
lastName: 'Lincoln' lastName: 'Lincoln'
...@@ -25,9 +25,9 @@ return sequelize.transaction(t) { ...@@ -25,9 +25,9 @@ return sequelize.transaction(t) {
}); });
``` ```
### Handled by user ### Handled manually
```js ```js
return sequelize.transaction().function (t) { return sequelize.transaction().then(function (t) {
return User.create({ return User.create({
firstName: 'Homer', firstName: 'Homer',
lastName: 'Simpson' lastName: 'Simpson'
...@@ -48,4 +48,4 @@ return sequelize.transaction().function (t) { ...@@ -48,4 +48,4 @@ return sequelize.transaction().function (t) {
The `transaction` option goes with most other options, which are usually the first argument of a method. The `transaction` option goes with most other options, which are usually the first argument of a method.
For methods that take values, like `.create`, `.update()`, `.updateAttributes()` and more `transaction` should be passed to the option in the second argument. For methods that take values, like `.create`, `.update()`, `.updateAttributes()` and more `transaction` should be passed to the option in the second argument.
If unsure, refer to the api documentation for the method you are using to be sure of the signature. If unsure, refer to the api documentation for the method you are using to be sure of the signature.
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!