Skip to content

Commit

Permalink
Merge pull request #1016 from scientist-softserv/edit-fileset-bug-fix
Browse files Browse the repository at this point in the history
🐛 User couldn't edit file sets
  • Loading branch information
ShanaLMoore authored Apr 19, 2024
2 parents 29f7e33 + 72b693a commit 4060ca5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/helpers/hyku_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ def admin_only_tenant_creation?
end

def parent_path(parent_doc)
model = parent_doc['has_model_ssim'].first
path = "hyrax_#{model.underscore}_path"
model = case parent_doc
when ActiveFedora::Base
parent_doc
when SolrDocument
parent_doc['has_model_ssim'].first.constantize
else
raise "Unknown parent_doc type: #{parent_doc.class}"
end

path = "#{model.model_name.singular_route_key}_path"
main_app.send(path, parent_doc.id)
end
end

0 comments on commit 4060ca5

Please sign in to comment.