class DoctrineIndexTableComponent < BaseComponent attr_reader :search_results, :opts def initialize(current_user:, search_results:, opts: {}) @search_results = search_results @opts = opts end def document_reference_number(document) document.reference_number end def document_title(document) return document.short_title if document.short_title.present? document.title end def date_or_year(document) return document.docdate.strftime("%m/%d/%Y") if document.docdate.present? document.year end end