dry-rb / dry-transaction

Business transaction DSL
http://dry-rb.org/gems/dry-transaction
MIT License
468 stars 55 forks source link

Ruby 3.0.0 - ArgumentError: wrong number of arguments (given 2, expected 1) #135

Closed MatUrbanski closed 3 years ago

MatUrbanski commented 3 years ago

I'm trying to use dry-transaction with Ruby 3.0.0. I tried to use examples from docs:

require "dry/transaction"

class CreateUser
  include Dry::Transaction

  step :validate
  step :create

  private

  def validate(input)
    # returns Success(valid_data) or Failure(validation)
  end

  def create(input)
    # returns Success(user)
  end
end

When I try to initialize CreateUser I receive the following error:

[20] pry(main)> CreateUser.new
ArgumentError: wrong number of arguments (given 2, expected 1)
from /Users/mateuszurbanski/.gem/ruby/3.0.0/gems/dry-transaction-0.13.0/lib/dry/transaction/instance_methods.rb:84:in `resolve_operation'
timriley commented 3 years ago

I think this should be fixed courtesy of #134 and released in 0.13.1.

Can you please try again and reopen if you have issues?