Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Add extension for ActiveRecord transactions #18

Merged
merged 5 commits into from
Jul 31, 2024

Commits on Jul 22, 2024

  1. feat: Add extention for ActiveRecord transactions

    This commit introduces a new extension to Dry::Operation that allows
    operations to be wrapped in ActiveRecord transactions. This is useful
    for ensuring atomicity of operations that involve multiple steps that
    need to be rolled back in case of failure. The extension provides a
    `transaction` method that can be used to wrap steps in a transaction.
    The transaction will be rolled back if any of the steps return a
    `Dry::Monads::Result::Failure`.
    
    The extension also supports specifying a custom ActiveRecord class to
    initiate the transaction, which is useful when working with multiple
    databases.
    tiev committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    3592922 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. Improve code from feedbacks

    - Fix information in doc.
    - Improve tests to get rid of `let!` and more reliable way to call model
    methods
    - Prevent verbose messages of AR migrations. Cleanup db after tests
    tiev committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    7b88e2c View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2024

  1. Allow passing options to ActiveRecord transactions

    This commit enhances the ActiveRecord extension of the Dry::Operation
    module to support additional options for the ActiveRecord transaction.
    These options can be set as default for all transactions or overridden
    at runtime. The changes include updates to the method signatures and
    the addition of new tests to verify the functionality.
    tiev committed Jul 27, 2024
    Configuration menu
    Copy the full SHA
    3c500ed View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Shorter param names to fix line length

    The line exceeds 100 characters. Shorter param names are still good
    enough.
    tiev committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    feaba6a View commit details
    Browse the repository at this point in the history
  2. Fix yard doc of method #transaction

    Move the yardoc comment block to the define_method block.
    With the stand-alone `@!method` block, yard always generate warning of
    unknown parameter name.
    tiev committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    71c08d4 View commit details
    Browse the repository at this point in the history