Skip to content

Commit

Permalink
Pacify the cops
Browse files Browse the repository at this point in the history
  • Loading branch information
laritakr committed Oct 11, 2024
1 parent a89b634 commit a0ee2bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
10 changes: 3 additions & 7 deletions lib/wings/active_fedora_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def apply_attributes_to_model(af_object)
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength

# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def parse_attributes(af_object)
converted_attrs = normal_attributes
af_object.attributes = converted_attrs.except(:members, :files, :file_name)
Expand All @@ -163,14 +163,10 @@ def parse_attributes(af_object)
files = converted_attrs.delete(:files)
af_object.files.build_or_set(files) if files
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength

def convert_based_near(based_near_string)
converted_based_near = []
based_near_string.each do |bn|
converted_based_near << Hyrax::ControlledVocabularies::Location.new(bn)
end
converted_based_near
based_near_string.map { |bn| Hyrax::ControlledVocabularies::Location.new(bn) }
end

def create_extrated_text(af_object)
Expand Down
8 changes: 5 additions & 3 deletions spec/wings/active_fedora_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@

context 'when given a valkyrie native model' do
let(:based_near) { "https://sws.geonames.org/4920808/" }
let(:resource) { klass.new(title: ['comet in moominland'],
distant_relation: ['Snufkin'],
based_near: [based_near]) }
let(:resource) do
klass.new(title: ['comet in moominland'],
distant_relation: ['Snufkin'],
based_near: [based_near])
end
let(:klass) { Hyrax::Test::Converter::Resource }

before do
Expand Down
4 changes: 2 additions & 2 deletions spec/wings/attribute_transformer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'wings/attribute_transformer'

RSpec.describe Wings::AttributeTransformer, :active_fedora do
let(:id) { 'moomin123' }
let(:id) { 'moomin123' }
let(:based_near) { Hyrax::ControlledVocabularies::Location.new("https://sws.geonames.org/4920808/") }
let(:work) { GenericWork.new(id: id, **attributes) }

Expand All @@ -14,7 +14,7 @@
title: ['fake title', 'fake title 2'],
contributor: ['user1'],
description: ['a description'],
based_near:[based_near]
based_near: [based_near]
}
end

Expand Down

0 comments on commit a0ee2bf

Please sign in to comment.