Skip to content

Commit

Permalink
don't force "Collection" model filter from the view
Browse files Browse the repository at this point in the history
the search builders for the target controller already search effectively for the
model class, and may have better strategies for doing so in the future. adding a
filter here prevents applications from using Collection models not named
"Collection".
  • Loading branch information
tamsin johnson authored and mcritchlow committed Aug 31, 2023
1 parent f9236a6 commit 5893bc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/hyrax/admin/collection_types/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<% unless collection_type.admin_set? || collection_type.user_collection? %>
<button class="btn btn-danger btn-sm delete-collection-type"
data-collection-type="<%= collection_type.to_json %>"
data-collection-type-index="<%= hyrax.dashboard_collections_path({ 'f[collection_type_gid_ssim][]' => collection_type.to_global_id.to_s, 'f[has_model_ssim][]' => 'Collection' }) %>"
data-collection-type-index="<%= hyrax.dashboard_collections_path({ 'f[collection_type_gid_ssim][]' => collection_type.to_global_id.to_s }) %>"
data-has-collections="<%= collection_type.collections.any? %>">
<%= t('helpers.action.delete') %>
</button>
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/hyrax_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
after(:create) do |collection, evaluator|
if evaluator.members.present?
evaluator.members.map do |member|
member.membner_of_collection_ids += [collection.id]
member.member_of_collection_ids += [collection.id]
member = Hyrax.persister.save(resource: member)
Hyrax.index_adapter.save(resource: member) if evaluator.with_index
end
Expand Down

0 comments on commit 5893bc5

Please sign in to comment.