class DocumentDoctrineIndexComponent < BaseComponent with_collection_parameter :doctrine attr_reader :doctrine, :opts def initialize(doctrine:, current_user:, opts: {}) @doctrine = doctrine @opts = opts end delegate :id, to: :doctrine delegate :subject_ids, to: :doctrine delegate :content, to: :doctrine delegate :document_id, to: :doctrine delegate :annotations, to: :doctrine delegate :subjects, to: :doctrine def doctrine_form_url jurisprudence_doctrines_path(jurisprudence_id: document_id) end def annotation_form_url doctrine_annotations_path(doctrine_id: id) end def subject_names "(No Subjects Provided)" end def render? doctrine.present? && doctrine.persisted? end end