Skip to content

Commit e2bb39b

Browse files
committed
Fixes validate! method
1 parent e3240b1 commit e2bb39b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/schema/validation.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module Schema
6060
end
6161

6262
def validate!
63-
valid? || raise Schema::Error.new(errors)
63+
valid? || raise errors.messages.join ","
6464
end
6565

6666
def errors
@@ -79,7 +79,7 @@ module Schema
7979
rules << Schema::Rule.new(:{{name.id}}, {{options[:message]}} || "") do |rule|
8080
{% for predicate, expected_value in options %}
8181
{% custom_validator = predicate.id.stringify.split('_').map(&.capitalize).join("") + "Validator" %}
82-
{% if !["message", "type", "inner", "nilable"].includes?(predicate.stringify) && CUSTOM_VALIDATORS[custom_validator] == nil %}
82+
{% if !["message", "param_type", "type", "inner", "nilable"].includes?(predicate.stringify) && CUSTOM_VALIDATORS[custom_validator] == nil %}
8383
rule.{{predicate.id}}?(@{{name.id}}, {{expected_value}}) &
8484
{% end %}
8585
{% end %}

0 commit comments

Comments
 (0)