lib/grape/validations/validators/base.rb in grape-1.5.0 vs lib/grape/validations/validators/base.rb in grape-1.5.1

- old
+ new

@@ -41,10 +41,11 @@ attributes = SingleAttributeIterator.new(self, @scope, params) # we collect errors inside array because # there may be more than one error per field array_errors = [] - attributes.each do |val, attr_name, empty_val| + attributes.each do |val, attr_name, empty_val, skip_value| + next if skip_value next if !@scope.required? && empty_val next unless @scope.meets_dependency?(val, params) begin validate_param!(attr_name, val) if @required || val.respond_to?(:key?) && val.key?(attr_name) rescue Grape::Exceptions::Validation => e