a11yist/app/models/success_criterion.rb
david 729ed13521
Some checks failed
/ Run tests (push) Failing after 1m19s
/ Run system tests (push) Failing after 1m18s
/ Build, push and deploy image (push) Has been skipped
start of iteration 2
2024-10-31 23:13:18 +01:00

26 lines
519 B
Ruby

# frozen_string_literal: true
class SuccessCriterion < ApplicationRecord
belongs_to :element, touch: true
belongs_to :check, optional: true
has_rich_text :test_comment
has_rich_text :quick_criterion
has_rich_text :quick_fail
has_rich_text :quick_fix
delegate :page, :report, to: :element
enum :result, %i[passed failed not_applicable]
enum :level, %i[A AA AAA]
def level_value
return nil unless level
self.class.levels.values.index_of(level)
end
def header
"HEADER"
end
end