ministryofjustice/atet

View on GitHub
app/validators/respondents_count_validator.rb

Summary

Maintainability
A
0 mins
Test Coverage
class RespondentsCountValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    return unless value.size > options[:maximum]

    record.errors.add(attribute, options[:message])
  end
end