Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jayanthdeejay/62ad9956f1209045ac330edd6d92f0e8 to your computer and use it in GitHub Desktop.
Save jayanthdeejay/62ad9956f1209045ac330edd6d92f0e8 to your computer and use it in GitHub Desktop.
Change ownership on works and files
work_ids = ActiveFedora::SolrService.query('depositor_ssim:dungavjk@mail.uc.edu AND has_model_ssim:Article', fl: "id", rows: 1000)
work_ids.each do |work|
pid = work['id']
article = Article.find(pid)
article.depositor = 'konecnmc@ucmail.uc.edu'
article.edit_users = ['konecnmc@ucmail.uc.edu']
article.save
article.file_sets.each do |file|
file.depositor = 'konecnmc@ucmail.uc.edu'
file.edit_users = ['konecnmc@ucmail.uc.edu']
file.creator = ['konecnmc@ucmail.uc.edu']
file.save
end
end
Becks - Articles 52
Peck - Articles 48
Dunga - Article 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment