forked from jeremyevans/sequel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Around hooks wrap both the related before and after hooks. In most cases, before and after hooks are sufficient, but if you need to be able to rescue exceptions raised by a before or after hook or the wrapped behavior (e.g. the actual insert/update/delete), you need to use an around hook. For example, you could use an around hook to turn DatabaseErrors caused by constraints into validation errors, assuming you could correctly parse error messages from the database. This only contains the specs and code changes, the update to the hook documentation will come soon.
- Loading branch information
1 parent
bd0e3fd
commit 2221e28
Showing
3 changed files
with
160 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters