Class: UltimaValidator

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

Constant Summary collapse

TWO_REQUESTS_MSG =
'Batches must contain exactly two requests.'
OT_RECIPE_CONSISTENT_MSG =
'OT Recipe must be the same for both requests.'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.validation_infoObject

Used in _pipeline_limit.html to display custom validation warnings



7
8
9
# File 'app/validators/ultima_validator.rb', line 7

def self.validation_info
  'OT Recipe must be the same for both requests.'
end

Instance Method Details

#validate(record) ⇒ Object

Validates that a batch contains the two requests.



12
13
14
15
# File 'app/validators/ultima_validator.rb', line 12

def validate(record)
  validate_exactly_two_requests(record)
  requests_have_same_ot_recipe(record)
end