Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jayanthdeejay/62ad9956f1209045ac330edd6d92f0e8 to your computer and use it in GitHub Desktop.

Select an option

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:[email protected] AND has_model_ssim:Article', fl: "id", rows: 1000)
work_ids.each do |work|
pid = work['id']
article = Article.find(pid)
article.depositor = '[email protected]'
article.edit_users = ['[email protected]']
article.save
article.file_sets.each do |file|
file.depositor = '[email protected]'
file.edit_users = ['[email protected]']
file.creator = ['[email protected]']
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