# Support for Ruby 3.1

**URL:** <https://discourse.dry-rb.org/t/support-for-ruby-3-1/1564>\
**Category:** dry-validation\
**Created:** [December 4, 2022, 9:09am UTC](https://discourse.dry-rb.org/t/support-for-ruby-3-1/1564 "2022-12-04T09:09:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samusgray](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/samusgray/32/819_2.png) [@samusgray](https://discourse.dry-rb.org/u/samusgray)\
**Post date:** [December 4, 2022, 9:09am UTC](https://discourse.dry-rb.org/t/support-for-ruby-3-1/1564/1 "2022-12-04T09:09:36Z")

</div>

Hello there,

We really love and depend on dry-transaction for a few of our features at work. Thanks for all the work you have put into it.

I’m working on our Ruby 3.1 upgrade and noticed my controllers that depend on this are all failing. We have some code that looks like this:

```auto
class MyStepAdapter < Dry::Transaction::StepAdapters
  def initialize(input)
    # a little logic that we need
    # and then:
    super
  end
end

```

And when running Rails with Ruby 3.1, I get this error:

```auto
 Failure/Error: super

      ArgumentError:
        wrong number of arguments (given 1, expected 0)

      # /usr/local/bundle/gems/dry-transaction-0.13.2/lib/dry/transaction/operation_resolver.rb:8:in `block (2 levels) in initialize'

```

I wonder if you have any plans to look into it or if I need to look into other options. Or could I be doing something wrong?

Thank you for your time reading this.

Saludes,  
[sgray@doximity.com](mailto:sgray@doximity.com)

---

<div class="post-metadata">

**Author:** ![alassek](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/alassek/32/314_2.png) [@alassek](https://discourse.dry-rb.org/u/alassek)\
**Post date:** [December 4, 2022, 10:36pm UTC](https://discourse.dry-rb.org/t/support-for-ruby-3-1/1564/2 "2022-12-04T22:36:23Z")

</div>

`StepAdapters` is just a `Dry::Core::Container` with sub-classes, why are you implementing `initialize` here? I don’t see that this class is ever actually initialized.

---

<div class="post-metadata">

**Author:** ![samusgray](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/samusgray/32/819_2.png) [@samusgray](https://discourse.dry-rb.org/u/samusgray)\
**Post date:** [December 5, 2022, 4:39pm UTC](https://discourse.dry-rb.org/t/support-for-ruby-3-1/1564/3 "2022-12-05T16:39:20Z")

</div>

Thank you for the response! I’m going to check with the team to see why we’re implementing `initialize`. It looks like it only sets a few instance variables, perhaps to use during steps. I’ll see if we can refactor away from that approach.

---

<div class="post-metadata">

**Author:** ![samusgray](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/samusgray/32/819_2.png) [@samusgray](https://discourse.dry-rb.org/u/samusgray)\
**Post date:** [December 7, 2022, 11:42pm UTC](https://discourse.dry-rb.org/t/support-for-ruby-3-1/1564/4 "2022-12-07T23:42:07Z")

</div>

We can close this. There was some confusion as to what the problem was; I suggested that we were subclassing `Dry::Transaction::StepAdapters` and overloading `#initialize`. The stacktrace actually pointed us to somewhere else in our codebase causing the issue. Thank you again for your time.
