You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
735 B

class DoctrineIndexTableComponent < BaseComponent
attr_reader :search_results, :opts
def initialize(current_user:, search_results:, opts: {})
@search_results = search_results
@opts = opts
end
def jurisprudence(search_result)
return "(No Assigned Document)" if search_result.doctrine_jurisprudences.blank?
search_result.doctrine_jurisprudences.first.jurisprudence
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