Class: BatchCreationValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/validators/batch_creation_validator.rb

Overview

A standard validator for batches. It checks that all requests in the batch are ready to be added to a batch, that the batch meets the minimum size, that the requests have the same read length, that the requests have the same flowcell type, and that the requests have the same target purpose.

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



7
8
9
10
11
12
13
# File 'app/validators/batch_creation_validator.rb', line 7

def validate(record)
  requests_have_same_read_length(record)
  requests_have_same_flowcell_type(record)
  batch_meets_minimum_size(record)
  all_requests_are_ready?(record)
  requests_have_same_target_purpose(record)
end