a11yist/app/models/checklist.rb
2024-07-20 16:55:10 +02:00

10 lines
368 B
Ruby

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