class Inferno::Repositories::TestSessions::Model

Public Instance Methods

before_create() click to toggle source
Calls superclass method
# File lib/inferno/repositories/test_sessions.rb, line 38
def before_create
  self.id = SecureRandom.uuid
  time = Time.now
  self.created_at ||= time
  self.updated_at ||= time
  super
end
validate() click to toggle source
Calls superclass method
# File lib/inferno/repositories/test_sessions.rb, line 46
def validate
  super
  errors.add(:test_suite_id, 'cannot be empty') if test_suite_id.blank?
  unless test_suites_repo.exists? test_suite_id # rubocop:disable Style/GuardClause
    errors.add(:test_suite_id, "'#{test_suite_id}' is not valid")
  end
end