Skip to content

Commit

Permalink
document prepend option in README
Browse files Browse the repository at this point in the history
  • Loading branch information
quentindemetz committed Feb 5, 2024
1 parent 6c531fc commit e282754
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Will be executed right after transaction in which it have been declared was roll

If called outside transaction will raise an exception!

Please keep in mind ActiveRecord's [limitations for rolling back nested transactions](http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#module-ActiveRecord::Transactions::ClassMethods-label-Nested+transactions). See [`in_transaction`](#in_transaction) for a workaround to this limitation.
Please keep in mind ActiveRecord's [limitations for rolling back nested transactions](http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#module-ActiveRecord::Transactions::ClassMethods-label-Nested+transactions). See [`in_transaction`](#in_transaction) for a workaround to this limitation.

### Available helper methods

Expand Down Expand Up @@ -139,7 +139,7 @@ class ServiceObjectBtw
end
```

Our service object can run its database operations safely when run in isolation.
Our service object can run its database operations safely when run in isolation.

```rb
ServiceObjectBtw.new.call # This opens a new #transaction block
Expand Down Expand Up @@ -195,6 +195,8 @@ end
- `:warn_and_execute` to print warning and execute immediately
- `:raise` to raise an exception instead of executing

- `prepend` puts the callback at the head of the callback chain, instead of at the end.

### FAQ

#### Does it works with transactional_test or DatabaseCleaner
Expand Down

0 comments on commit e282754

Please sign in to comment.