Skip to content

Commit

Permalink
[REFACTOR] Make EtdFileSetPresenter agnostic about underlying hash
Browse files Browse the repository at this point in the history
**RATIONALE**
We don't want the presenter to have to know details about the
uderlying SolrDocument implementation like attribute suffixes.
  • Loading branch information
mark-dce committed Sep 26, 2024
1 parent f6cf7bc commit 41043dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def partnering_agency
self[Solrizer.solr_name('partnering_agency')]
end

def pcdm_use
self[Solrizer.solr_name('pcdm_use')]&.first
end

def submitting_type
self[Solrizer.solr_name('submitting_type')]
end
Expand Down
6 changes: 1 addition & 5 deletions app/presenters/etd_file_set_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ class EtdFileSetPresenter < Hyrax::FileSetPresenter
to: :solr_document

def primary?
solr_document.fetch("pcdm_use_tesim", []).include?("primary")
end

def supplementary?
!primary?
pcdm_use == "primary"
end

def permission_badge
Expand Down

0 comments on commit 41043dc

Please sign in to comment.