These are chat archives for dry-rb/chat
Quick questons about dry-transaction. From the docs:
Each operation shouldn’t accumulate state, instead it should receive an input and return an output without causing any side-effects.
What about the persist example — doesn’t that operation have the side effect of saving to a DB?
schemaconstructor type the one appropriate for creating objects from user submitted form values. Eg, in the
processstep of a dry-transaction?
require "my_app/import" require_relative "form_schema" module MyApp module Posts class Create < Dry::Transaction::Operation include Import["post_repo"] def call(params) validation = FormSchema.(params) if validation.success? Success(post_repo.create(validation.to_h)) else Failure(validation) end end end end end