lib/trailblazer/macro/nested.rb in trailblazer-macro-2.1.4 vs lib/trailblazer/macro/nested.rb in trailblazer-macro-2.1.5

- old
+ new

@@ -36,11 +36,11 @@ # Since we do not know its outputs, we have to map them to :success and :failure, only. # # This is what {Nested} in 2.0 used to do, where the outcome could only be true/false (or success/failure). class Dynamic def initialize(nested_activity_decider) - @nested_activity_decider = Option::KW(nested_activity_decider) + @nested_activity_decider = Trailblazer::Option(nested_activity_decider) @outputs = { :success => Activity::Output(Activity::Railway::End::Success.new(semantic: :success), :success), :failure => Activity::Output(Activity::Railway::End::Failure.new(semantic: :failure), :failure) } @@ -51,10 +51,10 @@ # TaskWrap step. def compute_nested_activity(wrap_ctx, original_args) (ctx, _), original_circuit_options = original_args # TODO: evaluate the option to get the actual "object" to call. - activity = @nested_activity_decider.(ctx, original_circuit_options) + activity = @nested_activity_decider.(ctx, keyword_arguments: ctx.to_hash, **original_circuit_options) # Overwrite :task so task_wrap.call_task will call this activity. # This is a trick so we don't have to repeat logic from #call_task here. wrap_ctx[:task] = activity