Skip to content

Instantly share code, notes, and snippets.

@eduardodeoh
Created March 29, 2017 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduardodeoh/3ef63b21e0a4693d3c113365e3c4bb7d to your computer and use it in GitHub Desktop.
Save eduardodeoh/3ef63b21e0a4693d3c113365e3c4bb7d to your computer and use it in GitHub Desktop.
class MyOperationChild1 < MyOperationMaster
AutoInject = Trailblazer::Operation::AutoInject(MyContainer1)
include AutoInject[moldel_1_class: "api.v1.model.1.class"]
include AutoInject[moldel_2_class: "api.v1.model.2.class"]
end
class MyOperationChild2 < MyOperationMaster
AutoInject = Trailblazer::Operation::AutoInject(MyContainer2)
include AutoInject[moldel_1_class: "api.v1.model.1.class"]
include AutoInject[moldel_2_class: "api.v1.model.2.class"]
end
class MyOperationMaster < Trailblazer::Operation
step :step_one
step :step_two
def step_one(options, **)
options[:model_1_class].create(value: 1)
end
def step_two(options, **)
options[:model_2_class].create(value: 1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment