Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update member_of_presenters method to work with cc 2.0 #286

Merged
merged 1 commit into from
Jan 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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