Sha256: 9443ea7d0aff3368c804b365ef33a3d4904ac061d25cbea6df1da24ec666f11a
Contents?: true
Size: 1.18 KB
Versions: 19
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true module Decidim module Meetings # The data store for a AgendaItem in the Decidim::Meetings component. It stores a # title, description and duration to render inside meeting. class AgendaItem < Meetings::ApplicationRecord include Decidim::Traceable include Decidim::Loggable include Decidim::TranslatableResource translatable_fields :title, :description belongs_to :agenda, -> { order(:position) }, foreign_key: "decidim_agenda_id", class_name: "Decidim::Meetings::Agenda" has_many :agenda_item_children, foreign_key: "parent_id", class_name: "Decidim::Meetings::AgendaItem", inverse_of: :parent, dependent: :destroy belongs_to :parent, class_name: "Decidim::Meetings::AgendaItem", inverse_of: :agenda_item_children, optional: true default_scope { order(:position) } def self.first_class where(parent_id: nil) end def parent? return true unless parent_id end def self.agenda_item_children where.not(parent_id: nil) end def self.log_presenter_class_for(_log) Decidim::Meetings::AdminLog::AgendaItemPresenter end end end end
Version data entries
19 entries across 19 versions & 1 rubygems