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

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
### Auto commit/rollback
```js
return sequelize.transaction(t) {
return sequelize.transaction(function (t) {
return User.create({
firstName: 'Abraham',
lastName: 'Lincoln'
......@@ -25,9 +25,9 @@ return sequelize.transaction(t) {
});
```
### Handled by user
### Handled manually
```js
return sequelize.transaction().function (t) {
return sequelize.transaction().then(function (t) {
return User.create({
firstName: 'Homer',
lastName: 'Simpson'
......@@ -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.
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.
\ No newline at end of file
If unsure, refer to the api documentation for the method you are using to be sure of the signature.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!