Skip to content

Commit

Permalink
Fixes Rubocop errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Scherz committed Apr 5, 2024
1 parent c624066 commit c62bf9c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions app/forms/hyrax/generic_work_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ def primary_terms

## Gymnastics to allow repeatble fields to behave as non-repeatable

def self.model_attributes(_)
attrs = super
attrs[:title] = Array(attrs[:title]) if attrs[:title]
attrs[:description] = Array(attrs[:description]) if attrs[:description]
attrs[:date_created] = Array(attrs[:date_created]) if attrs[:date_created]
attrs
end
# def self.model_attributes(_)
# attrs = super
# attrs[:title] = Array(attrs[:title]) if attrs[:title]
# attrs[:description] = Array(attrs[:description]) if attrs[:description]
# attrs[:date_created] = Array(attrs[:date_created]) if attrs[:date_created]
# attrs
# end

def self.model_attributes(attributes)
attrs = super
return attrs unless attributes[:title]
attrs = super
return attrs unless attributes[:title]

attrs[:title] = Array(attributes[:title])
return attrs if attributes[:alternate_title].nil?
Array(attributes[:alternate_title]).each do |value|
attrs["title"] << value if value != ""
end
attrs
end
attrs[:title] = Array(attributes[:title])
return attrs if attributes[:alternate_title].nil?
Array(attributes[:alternate_title]).each do |value|
attrs["title"] << value if value != ""
end
attrs
end

def title
super.first || ""
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/hyrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
# end

# Returns a URL that resolves to an info.json file provided by a IIIF image server
config.iiif_info_url_builder = lambda do |file_id, base_url, size, format|
config.iiif_info_url_builder = lambda do |file_id, base_url, _size, _format|
uri = Riiif::Engine.routes.url_helpers.info_url(file_id, host: base_url)
uri.sub(%r{/info\.json\Z}, '')
end
Expand Down

0 comments on commit c62bf9c

Please sign in to comment.