From 817b45b433765ed6f3d56e0f09ef5f3f019b5f20 Mon Sep 17 00:00:00 2001 From: Johnathan Martin Date: Wed, 8 Nov 2023 12:12:22 -0800 Subject: [PATCH] make Cocina::Models::Validators::DarkValidator#invalid_files a bit more concise/idiomatic cribbed off this class for LanguageTagValidator, switched to something more concise for a similar method there, doing the same here see https://github.com/sul-dlss/cocina-models/pull/643 --- lib/cocina/models/validators/dark_validator.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/cocina/models/validators/dark_validator.rb b/lib/cocina/models/validators/dark_validator.rb index a570221a..bb8c92ac 100644 --- a/lib/cocina/models/validators/dark_validator.rb +++ b/lib/cocina/models/validators/dark_validator.rb @@ -39,12 +39,7 @@ def dro? end def invalid_files - @invalid_files ||= - [].tap do |invalid_files| - files.each do |file| - invalid_files << file if invalid?(file) - end - end + @invalid_files ||= files.select { |file| invalid?(file) } end def invalid_filenames