Skip to content

Commit

Permalink
Merge branch 'feature/41-multiple-download-links' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Feb 29, 2024
2 parents f9d34ae + afdf105 commit 096c929
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/models/document_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ def self.import(file)
::CSV.foreach(file.path, headers: true) do |row|
logger.debug("CSV Row: #{row.to_hash}")
document_access = DocumentAccess.find_or_initialize_by(friendlier_id: row[0], institution_code: row[1])
document_access.update(row.to_hash)
document_access.update!(row.to_hash)
end
true
end

def self.destroy_all(file)
Expand All @@ -25,6 +26,7 @@ def self.destroy_all(file)
logger.debug("CSV Row: #{row.to_hash}")
DocumentAccess.destroy_by(id: row[0], friendlier_id: row[1])
end
true
end

def to_csv
Expand Down
4 changes: 3 additions & 1 deletion app/models/document_download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ def self.import(file)
::CSV.foreach(file.path, headers: true) do |row|
logger.debug("CSV Row: #{row.to_hash}")
document_download = DocumentDownload.find_or_initialize_by(friendlier_id: row[0], label: row[1], value: row[2])
document_download.update(row.to_hash)
document_download.update!(row.to_hash)
end
true
end

def self.destroy_all(file)
Expand All @@ -25,6 +26,7 @@ def self.destroy_all(file)
logger.debug("CSV Row: #{row.to_hash}")
DocumentDownload.destroy_by(id: row[0], friendlier_id: row[1])
end
true
end

def to_csv
Expand Down
2 changes: 1 addition & 1 deletion geoblacklight_admin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "m", "~> 1.5"
s.add_development_dependency "minitest", "~> 5.18"
s.add_development_dependency "minitest-ci", "~> 3.4"
s.add_development_dependency "minitest-rails", "~> 6.1"
s.add_development_dependency "minitest-rails", "~> 7.0"
s.add_development_dependency "minitest-reporters", "~> 1.6"
s.add_development_dependency "rspec-rails", "~> 3.0"
s.add_development_dependency "selenium-webdriver"
Expand Down

0 comments on commit 096c929

Please sign in to comment.