Project

General

Profile

Download (383 Bytes) Statistics
| Branch: | Tag: | Revision:
class MigrateInstallationMediumUri < ActiveRecord::Migration
def up
Medium.unscoped.all.each do |medium|
matches = /^([^:]+):(\/.+)/.match(medium.path)

if matches.size == 3 and ![ 'http', 'https', 'ftp', 'ftps', 'nfs' ].include?(matches[1])
medium.path = 'nfs://' + matches[1] + matches[2]
medium.save
end
end
end

def down
end
end
(37-37/281)