Skip to content

Commit

Permalink
update member_of_presenters method to work with cc 2.0 (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan authored and tampakis committed Jan 6, 2017
1 parent fa4b058 commit eecdd8f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/presenters/geo_concerns/geo_concerns_show_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ def external_metadata_file_set_presenters

def parent_work_presenters
# filter out collection presenters
collection_presenters.select do |member|
member_of_presenters.select do |member|
member.model_name.name != "Collection"
end
end

def member_of_presenters
CurationConcerns::PresenterFactory.build_presenters(member_of_ids,
collection_presenter_class,
*presenter_factory_arguments)
end

def member_of_ids
ActiveFedora::SolrService.query("{!field f=member_ids_ssim}#{id}",
fl: ActiveFedora.id_field)
.map { |x| x.fetch(ActiveFedora.id_field) }
end

def attribute_to_html(field, options = {})
if field == :coverage
GeoConcerns::CoverageRenderer.new(field, send(field), options).render
Expand Down

0 comments on commit eecdd8f

Please sign in to comment.