a11yist/app/models/checklist.rb
david 63fc206c27
Some checks failed
/ Run tests (push) Successful in 8m56s
/ Run system tests (push) Failing after 1h0m48s
/ Build, push and deploy image (push) Successful in 7m47s
A lot :)
2024-09-05 22:54:38 +02:00

12 lines
399 B
Ruby

# frozen_string_literal: true
class Checklist < ApplicationRecord
has_many :checklist_entries, -> { order(position: :asc) }, dependent: :destroy, inverse_of: :checklist
has_many :checks, through: :checklist_entries
has_rich_text :description_html
accepts_nested_attributes_for :checklist_entries, reject_if: :all_blank, allow_destroy: true
delegate :empty?, to: :checklist_entries
end