class ExaminationItem < ApplicationRecord enum item_type: { SINGLE: 0, MULTIPLE: 1, JUDGMENT: 2, COMPLETION: 3, SUBJECTIVE: 4, PRACTICAL: 5, PROGRAM: 6 } belongs_to :examination_bank, touch: true belongs_to :item_bank, optional: true has_many :examination_item_choices, dependent: :destroy has_one :examination_item_analysis, dependent: :destroy belongs_to :container, polymorphic: true, optional: true def analysis examination_item_analysis&.analysis end def item_choices examination_item_choices end def public 0 end def quotes 0 end end