Skip to content

Commit

Permalink
call the cops
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Jan 16, 2024
1 parent 1503cda commit a762f14
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/controllers/bulkrax/entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def destroy
end

protected

# GET /importers/1/entries/1
def show_importer
@importer = Importer.find(params[:importer_id])
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/bulkrax/importers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ def update_harvest
def set_files_parser_fields
@importer.parser_fields['update_files'] =
@importer.parser_fields['replace_files'] =
@importer.parser_fields['remove_and_rerun'] =
@importer.parser_fields['metadata_only'] = false
@importer.parser_fields['remove_and_rerun'] =
@importer.parser_fields['metadata_only'] = false
if params[:commit] == 'Update Metadata and Files'
@importer.parser_fields['update_files'] = true
elsif params[:commit] == ('Update and Replace Files' || 'Update and Re-Harvest All Items')
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/bulkrax/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
module Bulkrax
module ApplicationHelper
def item_entry_path(item, e, opts = {})
is_an_importer?(item) ? bulkrax.importer_entry_path(item.id, e.id, opts) : bulkrax.exporter_entry_path(item.id, e.id, opts)
an_importer?(item) ? bulkrax.importer_entry_path(item.id, e.id, opts) : bulkrax.exporter_entry_path(item.id, e.id, opts)
end

def is_an_importer?(item)
def an_importer?(item)
item.class.to_s.include?('Importer')
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/bulkrax/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'iso8601'

module Bulkrax
class Importer < ApplicationRecord
class Importer < ApplicationRecord # rubocop:disable Metrics/ClassLength
include Bulkrax::ImporterExporterBehavior
include Bulkrax::StatusInfo

Expand Down
2 changes: 1 addition & 1 deletion app/views/bulkrax/shared/_entries_tab.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<td><%= e.status_at %></td>
<td>
<%= link_to raw('<span class="glyphicon glyphicon-info-sign"></span>'), item_entry_path(item, e) %>
<% if is_an_importer?(item) %>
<% if an_importer?(item) %>
<a class="glyphicon glyphicon-refresh" data-toggle="modal" data-target="#bulkraxItemModal" data-entry-id="<%= e.id %>"></a>
<% end %>
<%= link_to raw('<span class="glyphicon glyphicon-trash"></span>'), item_entry_path(item, e), method: :delete, data: { confirm: 'This will delete the entry and any work associated with it. Are you sure?' } %>
Expand Down

0 comments on commit a762f14

Please sign in to comment.