Sha256: 89d3b59ffb28cb72689ffebb9bda151118cc294511202512a4ed224a1302a8d3
Contents?: true
Size: 666 Bytes
Versions: 15
Compression:
Stored size: 666 Bytes
Contents
# frozen_string_literal: true namespace :hyrax do namespace :collections do desc 'Update CollectionType global id references for Hyrax 3.0.0' task update_collection_type_global_ids: :environment do puts 'Updating collection -> collection type GlobalId references.' count = 0 Collection.all.each do |collection| next if collection.collection_type_gid == collection.collection_type.to_global_id.to_s collection.public_send(:collection_type_gid=, collection.collection_type.to_global_id, force: true) collection.save && count += 1 end puts "Updated #{count} collections." end end end
Version data entries
15 entries across 15 versions & 1 rubygems