a11yist/app/models/checklist.rb

13 lines
399 B
Ruby
Raw Normal View History

2024-09-05 22:54:38 +02:00
# 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
2024-07-19 02:29:18 +02:00
has_rich_text :description_html
accepts_nested_attributes_for :checklist_entries, reject_if: :all_blank, allow_destroy: true
2024-07-20 16:52:12 +02:00
delegate :empty?, to: :checklist_entries
end