Class: Inferno::Repositories::TestRuns::Model

Inherits:
Object
  • Object
show all
Includes:
ValidateRunnableReference
Defined in:
lib/inferno/repositories/test_runs.rb

Constant Summary

Constants included from ValidateRunnableReference

ValidateRunnableReference::REFERENCE_KEYS

Instance Method Summary collapse

Methods included from ValidateRunnableReference

#check_runnable_reference, #runnable_reference_exists?

Instance Method Details

#before_createObject



118
119
120
121
122
123
124
# File 'lib/inferno/repositories/test_runs.rb', line 118

def before_create
  self.id = SecureRandom.uuid
  time = Time.now
  self.created_at ||= time
  self.updated_at ||= time
  super
end

#validateObject



111
112
113
114
115
116
# File 'lib/inferno/repositories/test_runs.rb', line 111

def validate
  super
  if status.present? && !Entities::TestRun::STATUS_OPTIONS.include?(status) # rubocop:disable Style/GuardClause
    errors.add(:status, "'#{status}' is not valid")
  end
end