Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add protection of stubbed methods from being called within a db transaction #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 21, 2019

  1. Fix Gemfile

    nepalez committed Sep 21, 2019
    Configuration menu
    Copy the full SHA
    68c67fe View commit details
    Browse the repository at this point in the history
  2. Prevent calling a stabbed method within a transaction

    With a new setting `within_transaction: false` you can prevent
    calling a stabbed method within a database transaction.
    
    ```yaml
    ---
    - class: Foo
      chain:
        - bar
        - baz
      within_transaction: false
      actions:
        - return: 0
    ```
    
    If you call the method inside a transaction, the call will raise
    an exception `::Isolator::UnsafeOperationError` pointing to
    the method `Foo.bar.baz(*)`.
    
    Notice that this setting is argument-specific. You can allow it
    to be called inside a transaction with some arguments, and
    <explicitly> forbid for some other arguments at the same time.
    nepalez committed Sep 21, 2019
    Configuration menu
    Copy the full SHA
    0e4ad0f View commit details
    Browse the repository at this point in the history