a11yist/app/models/check.rb

11 lines
423 B
Ruby

class Check < ApplicationRecord
include RichTextTargetBlank
enum :level, %i[A AA AAA]
has_rich_text :success_criterion_html
scope :search, lambda { |term|
joins("INNER JOIN action_text_rich_texts ON action_text_rich_texts.record_id = checks.id AND record_type = 'Check'").where('checks.name LIKE :term OR action_text_rich_texts.body_text LIKE :term', term: "%#{term}%")
}
end