Skip to content

Commit ac446c8

Browse files
committed
Fix ValidationError initialization to allow default empty errors array
- Updated the ValidationError class to initialize with a default empty array for errors, improving error handling flexibility. - Enhanced code clarity by separating the error array declaration from the constructor.
1 parent e52d279 commit ac446c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/active_record/validations.cr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ module CQL
200200
end
201201

202202
class ValidationError < Exception
203-
def initialize(@errors : Array(Error))
203+
@errors : Array(Error)
204+
205+
def initialize(@errors : Array(Error) = [] of Error)
204206
end
205207

206208
def message

0 commit comments

Comments
 (0)