Skip to content

Instantly share code, notes, and snippets.

@alexpeachey
Last active October 11, 2017 19:20
Show Gist options
  • Save alexpeachey/efe4f3d5dfb6f63309093a2a267c4ce2 to your computer and use it in GitHub Desktop.
Save alexpeachey/efe4f3d5dfb6f63309093a2a267c4ce2 to your computer and use it in GitHub Desktop.
Example Transaction 1
module Transactions
module Posts
Create = Dry.Transaction(container: {}) do
step :validate, with: Components::Posts::Create::Validate
step :load_topic, with: Components::Posts::Create::LoadTopic
step :build_post, with: Components::Posts::Create::BuildPost
step :save_post, with: Components::Posts::Create::SavePost
step :extract_post, with: Components::Posts::Create::ExtractPost
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment