The blog post introducing dry-transaction 0.10 gives an example of how to build a base class to use for one’s own transactions. There are a couple of problems:
self.inherited should be
- The new base class’
call ends up higher up in the ancestors list than the included
Dry::Transaction module, so it is never invoked.
In sum, this is what I had to do:
def call(input, wrapper_class = nil)
# custom stuffz
klass.send :include, Dry::Transaction
klass.send :prepend, InstanceMethods
Not sure if this should be filed as a bug. If not, maybe the blog post could be updated?
Or maybe I misunderstood something?
Anyway—thanks for dry-rb! It’s changing the way we write code at my job.