Skip to content

Releases: dry-rb/dry-transaction

v0.16.0

17 Jan 06:47
v0.16.0
6b5923c
Compare
Choose a tag to compare

Changed

Compare v0.15.0...v0.16.0

v0.15.0

16 Nov 17:20
v0.15.0
a7a7ca1
Compare
Choose a tag to compare

Changed

  • Dependencies were bumped to exclude dry-container (@flash-gordon)

Compare v0.14.0...v0.15.0

v0.14.0

21 Oct 04:11
v0.14.0
Compare
Choose a tag to compare

Changed

  • Updated to work with latest dry-events and dry-monads using Zeitwerk for auto-loading (see #142) (@kzaitsev)

Compare v0.13.3...v0.14.0

v0.13.3

07 Jun 07:49
v0.13.3
18af243
Compare
Choose a tag to compare

Fixed

  • Fix deprecation warning on Ruby 3.0 when there are empty hash-like args (via #137) (@bestwebua)

Compare v0.13.2...v0.13.3

v0.13.2

08 Feb 11:09
Compare
Choose a tag to compare

Fixed

  • Re-allow Hash-like parameters to be passed to steps, e.g. HashWithIndifferentAccess and other Hash subclasses (this was broken with the Ruby 2.7/3.0 fixes in 0.13.1) (@trammel in #136)

Compare v0.13.1...v0.13.2

v0.13.1

31 Jan 11:41
Compare
Choose a tag to compare

Changed

  • Resolve Ruby 2.7 deprecation warnings and support Ruby 3.0 (@robbl-as in PR #134)

Compare v0.13.0...v0.13.1

0.13.0

13 Jun 11:22
Compare
Choose a tag to compare

0.13.0 / 2018-06-13

Changed

  • Internal step operations (steps backed by instance methods) can now be replaced via constructor arguments. Using instance methods to wrap external step operations now only works if the step is defined using the with: option (timriley in #109)

Compare v0.12.1...v0.13.0

0.11.0

19 Feb 00:48
Compare
Choose a tag to compare

Added

  • Around steps, which allow control of the execution of subsequently called steps. If you know how middleware works in rack or how around callbacks can be used in RSpec, it's the same. A typical example of usage would be for DB transactions (now first class support!) or controlling side effects: rolling back the changes, cleaning garbage produced by a failed transaction, etc. See a more detailed explanation of how this works in the PR (flash-gordon in #85)
  • Broadcast when a step has started by sending the event step_called (mihairadulescu in #82)
  • Add new step check that returns Success or Failure base on conditions (semenovDL in #84)
  • Support for transaction steps without input values (GustavoCaso and timriley in #69)

Changed

  • [BREAKING] Steps no longer broadcast events with their step name followed by _success or _failure. Now, more generic names are used for the broadcast events. Before each step runs, a step event is broadcast, with the step name and its arguments. After a step runs, a step_succeeded or step_failed event is broadcast, also with the step name, the arguments and the return value (GustavoCaso in #83)
  • [BREAKING] Pub/sub support is now handled using dry-events instead of wisper. Subscriber objects should now respond to #on_step, #on_step_succeeded, or #on_step_failed to receive broadcast events (GustavoCaso in #90)
  • [BREAKING] The step adapter API has been changed in order to support around steps, although, the changes are not significant. Previously, an adapter received a step and a list of arguments for calling the operation. The list was passed as *args then you were needed to call call_operation on step and provide the list. From now on an adapter gets an operation, its options, and args (without *). operation is an ordinary callable object so a typical call is as simple as operaiton.(*args), that's it. If you want to turn your adapter into an around-like one you need to add &block parameter to the list of call arguments (e.g. def call(operation, options, args, &block)). block is responsible for calling the subsequent steps thus you can check or transform the return value and make some decisions based on it. Note capturing the block in the list of arguments is mandatory, a simple yield won't work, there are reasons, believe us. Check out the sources of around.rb for reference, it's dead simple (flash-gordon in #85)
  • Usages of the Either monad was updated with Result and its constructors. See the changes in dry-monads for more details (flash-gordon in #81)
  • Minimal Ruby version is 2.2 (flash-gordon in #72)

Fixed

  • Pass arguments to a step with keyword arguments with default values (flash-gordon in #74)
  • Steps can be wrapped with private methods (semenovDL in #70)
  • Improved error message on missing transaction step (Morozzzko in #79)

Compare v0.10.2...v0.11.0

0.10.2

10 Jul 03:48
Compare
Choose a tag to compare

Fixed

  • Only resolve an operation object from the container if the container reports that the key is present. This prevents exceptions from being raised when using dry-container and defining a transaction that includes steps both container-based and local method steps (jonolsson in #64)

0.10.1

29 Jun 23:57
Compare
Choose a tag to compare

Fixed

  • Preserve step notification listeners when calling a transaction after passing extra step arguments (jcmfernandes in #65)

Compare v0.10.0...v0.10.1