10 lines
247 B
Ruby
10 lines
247 B
Ruby
class MigrateMaterialPhotosToFiles < ActiveRecord::DataMigration
|
|
def up
|
|
photos = ActiveStorage::Attachment.where(name: "photos", record_type: "MaterialRelease")
|
|
|
|
photos.each do |photo|
|
|
photo.update(name: "files")
|
|
end
|
|
end
|
|
end
|