Skip to content

Commit

Permalink
download method finished
Browse files Browse the repository at this point in the history
  • Loading branch information
kostik committed Oct 12, 2023
1 parent bb58a43 commit 8ca8a4b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/models/study_downloader.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
class StudyDownloader
def self.download(nct_ids)
# code goes here to download the list of studies

nct_ids.each do |nct_id|
record = StudyJsonRecord.find_by(nct_id: nct_id) || StudyJsonRecord.create(nct_id: nct_id, content: {})
record.update_from_api
puts "Study id: #{record.id}, study nct_id: #{record.nct_id}, version: #{record.version}"
end

end
end
end

0 comments on commit 8ca8a4b

Please sign in to comment.