Let context fail if population of match below fails
This commit is contained in:
parent
f35ba5c745
commit
213867a827
|
|
@ -8,7 +8,9 @@ class AdvanceTeamsInIntermediateStage
|
|||
return if intermediate_stage.nil?
|
||||
|
||||
intermediate_stage.matches.select { |m| m.state == 'single_team' }
|
||||
.each { |match| PopulateMatchBelowAndSave.call(match: match) }
|
||||
.each do |match|
|
||||
context.fail! unless PopulateMatchBelowAndSave.call(match: match).success?
|
||||
end
|
||||
(context.object_to_save ||= []) << intermediate_stage
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue