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

♻️ Favor asking about model_name over class #934

Merged
merged 1 commit into from
Mar 8, 2024
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
16 changes: 8 additions & 8 deletions app/views/bulkrax/entries/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@
<% if @importer.present? %>
<% factory_record = @entry.factory.find %>
<% if factory_record.present? && @entry.factory_class %>
<strong><%= @entry.factory_class.to_s %> Link:</strong>
<% if @entry.factory_class.to_s == 'Collection' %>
<%= link_to @entry.factory_class.to_s, hyrax.polymorphic_path(factory_record) %>
<strong><%= @entry.factory_class.model_name.human %> Link:</strong>
<% if defined?(Hyrax) && @entry.factory_class.model_name.human == 'Collection' %>
<%= link_to @entry.factory_class.model_name.human, hyrax.polymorphic_path(factory_record) %>
<% else %>
<%= link_to @entry.factory_class.to_s, main_app.polymorphic_path(factory_record) %>
<%= link_to @entry.factory_class.model_name.human, main_app.polymorphic_path(factory_record) %>
<% end %>
<% else %>
<strong>Item Link:</strong> Item has not yet been imported successfully
<% end %>
<% else %>
<% record = @entry&.hyrax_record %>
<% if record.present? && @entry.factory_class %>
<strong><%= record.class.to_s %> Link:</strong>
<% if defined?(Collection) && record.is_a?(Collection) %>
<%= link_to record.class.to_s, hyrax.polymorphic_path(record) %>
<strong><%= record.model_name.human %> Link:</strong>
<% if defined?(Hyrax) && record.model_name.human == "Collection" %>
<%= link_to record.model_name.human, hyrax.polymorphic_path(record) %>
<% else %>
<%= link_to record.class.to_s, main_app.polymorphic_path(record) %>
<%= link_to record.model_name.human, main_app.polymorphic_path(record) %>
<% end %>
<% else %>
<strong>Item Link:</strong> No item associated with this entry or class unknown
Expand Down
Loading