add pagy, improve checks#index

This commit is contained in:
david 2024-07-21 00:33:38 +02:00
parent c44c9ccaba
commit 6d3a269231
11 changed files with 274 additions and 10 deletions

View file

@ -4,4 +4,8 @@ class Check < ApplicationRecord
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 LIKE :term', term: "%#{term}%")
}
end