lib/dry/logic/rule/result.rb in dry-logic-0.1.1 vs lib/dry/logic/rule/result.rb in dry-logic-0.1.2

- old
+ new

@@ -1,12 +1,16 @@ module Dry module Logic class Rule::Result < Rule def call(input) result = input[name] - return result unless result.success? result_input = result.input - Result::Wrapped.new(input, predicate.(result_input), self) + + if result.success? + Result::Wrapped.new(input, predicate.(result_input), self) + else + result + end end def type :res end