diff --git a/.rubocop.yml b/.rubocop.yml index 3e833e0..c37a8e3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + inherit_gem: bixby: bixby_default.yml diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..dacdd37 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,21 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2019-02-21 09:32:03 -0500 using RuboCop version 0.52.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +Metrics/CyclomaticComplexity: + Max: 7 + +# Offense count: 1 +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 228 + +# Offense count: 1 +Metrics/PerceivedComplexity: + Max: 8 diff --git a/lib/darlingtonia/hyrax_record_importer.rb b/lib/darlingtonia/hyrax_record_importer.rb index d6b8b9e..49083b9 100644 --- a/lib/darlingtonia/hyrax_record_importer.rb +++ b/lib/darlingtonia/hyrax_record_importer.rb @@ -160,6 +160,7 @@ def create_for(record:) uploaded_files: create_upload_files(record), depositor: @depositor.user_key } + created = import_type.new attrs = record.attributes.merge(additional_attrs) @@ -177,7 +178,7 @@ def create_for(record:) @success_count += 1 else created.errors.each do |attr, msg| - error_stream << "event: validation_failed, batch_id: #{batch_id}, collection_id: #{collection_id}, attribute: #{attr.capitalize}, message: #{msg}, record_title: #{attrs[:title].first}" + error_stream << "event: validation_failed, batch_id: #{batch_id}, collection_id: #{collection_id}, attribute: #{attr.capitalize}, message: #{msg}, record_title: record_title: #{attrs[:title] ? attrs[:title] : attrs}" end @failure_count += 1 end