mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 11:42:19 -05:00
9 lines
251 B
Ruby
9 lines
251 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RegexArrayValidator < ActiveModel::EachValidator
|
|
def validate_each(record, attribute, value)
|
|
return unless value.any? { |pattern| pattern.to_regexp.nil? }
|
|
record.errors.add(attribute, :invalid)
|
|
end
|
|
end
|