Skip to content

Commit

Permalink
Adding one off script for generating OsfArchive
Browse files Browse the repository at this point in the history
Related to DLTP-784
  • Loading branch information
Jeremy Friesen committed Jan 9, 2017
1 parent 7a5384d commit a0c3d7e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions script/one-off/DLTP-721-seed-data.rb
@@ -0,0 +1,16 @@
attributes = {
osf_project_identifier: 'abcde',
source: 'https://osf.io/abcde',
title: 'Example OSF Project',
description: "Many Bothan's died to bring you this project",
visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
}

previous_project = OsfArchive.create!(attributes.merge(date_archived: '2016-01-02'))
registration = OsfArchive.create!(attributes.merge(date_archived: '2016-02-02', source: 'https://osf.io/12345'))
project = OsfArchive.create!(attributes.merge(date_archived: '2016-03-02', previousVersion: previous_project))

puts "Previous Project URL: http://localhost:3000/show/#{previous_project.noid}"
puts "Registration URL: http://localhost:3000/show/#{registration.noid}"
puts "Project URL: http://localhost:3000/show/#{project.noid}"
`open http://localhost:3000/show/#{project.noid}`

0 comments on commit a0c3d7e

Please sign in to comment.