Module: Pipeline::BatchValidation

Included in:
Pipeline
Defined in:
app/models/pipeline/batch_validation.rb

Instance Method Summary collapse

Instance Method Details

#validation_of_batch(batch) ⇒ Object


2
3
4
5
6
7
8
9
10
# File 'app/models/pipeline/batch_validation.rb', line 2

def validation_of_batch(batch)
  # Using throw and catch enables us to skip over the request validation without actually
  # having to know whether it was needed or not.
  catch(:no_requests_in_batch) do
    validation_of_requests(batch.requests) do |message|
      batch.errors.add(:requests, message)
    end
  end
end

#validation_of_batch_for_completion(batch) ⇒ Object

Overridden by pipeline implementations to ensure that the batch is valid for completion. By default this does nothing.


22
23
# File 'app/models/pipeline/batch_validation.rb', line 22

def validation_of_batch_for_completion(batch)
end