Class: CurationConcerns::DataMigration::CollectionsMigration

Inherits:
Object
  • Object
show all
Defined in:
lib/curation_concerns/data_migration/collections_migration.rb

Class Method Summary collapse

Class Method Details

.runObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/curation_concerns/data_migration/collections_migration.rb', line 4

def self.run
  ::Collection.all.each do |collection|
    collection.members.each do |member|
      member.member_of_collections << collection
      member.save
    end
    collection.members = []
    collection.save
  end
end