lib/alba/conditional_attribute.rb in alba-2.0.1 vs lib/alba/conditional_attribute.rb in alba-2.1.0

- old
+ new

@@ -18,10 +18,10 @@ # @return [Alba::REMOVE_KEY, Object] REMOVE_KEY if condition is unmet, fetched attribute otherwise def with_passing_condition(resource:, object: nil) return Alba::REMOVE_KEY unless condition_passes?(resource, object) fetched_attribute = yield(@body) - return fetched_attribute if fetched_attribute.nil? || !with_two_arity_proc_condition + return fetched_attribute if !with_two_arity_proc_condition return Alba::REMOVE_KEY unless resource.instance_exec(object, attribute_from_association_body_or(fetched_attribute), &@condition) fetched_attribute end