Class: ExtendedValidator

Inherits:
ApplicationRecord show all
Defined in:
app/models/extended_validator.rb

Overview

Extended validators are used to provide extra validation of submission. They are associated with request types and will import validation behaviour into submission.

behaviour => the module that will be included in the validator, must respond to validate(submission) options => serialized hash for configuration

Defined Under Namespace

Modules: SpeciesValidator Classes: RequestTypeExtendedValidator

Instance Method Summary collapse

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#import_behaviourObject


21
22
23
24
25
26
27
28
# File 'app/models/extended_validator.rb', line 21

def import_behaviour
  return if behaviour.nil?

  behavior_module = "ExtendedValidator::#{behaviour}".constantize
  class_eval do
    include(behavior_module)
  end
end