sanger/limber

View on GitHub
app/models/validators/suboptimal_validator.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module Validators
  class SuboptimalValidator < ActiveModel::Validator # rubocop:todo Style/Documentation
    def validate(presenter)
      return true unless presenter.labware.wells.any?(&:suboptimal?)

      presenter.errors.add(:wells, 'contain suboptimal aliquots')
    end
  end
end