a11yist/app/models/check.rb

12 lines
423 B
Ruby
Raw Normal View History

class Check < ApplicationRecord
2024-07-20 16:52:12 +02:00
include RichTextTargetBlank
enum :level, %i[A AA AAA]
2024-07-19 02:29:18 +02:00
has_rich_text :success_criterion_html
2024-07-21 00:33:38 +02:00
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}%")
2024-07-21 00:33:38 +02:00
}
end