2016-01-20 02:18:44 +00:00
|
|
|
class Metacode < ActiveRecord::Base
|
|
|
|
end
|
|
|
|
|
2016-01-20 02:18:22 +00:00
|
|
|
class MetacodeAssetPathUpdate < ActiveRecord::Migration
|
|
|
|
def change
|
|
|
|
Metacode.first(50).each do |metacode|
|
2016-07-26 00:14:23 +00:00
|
|
|
next unless metacode.icon.start_with?('/assets/icons/')
|
|
|
|
metacode.icon = metacode.icon.sub(/^\/assets\/icons/, 'https://s3.amazonaws.com/metamaps-assets/metacodes')
|
|
|
|
metacode.icon = metacode.icon.sub('blueprint_96px', 'blueprint/96px')
|
|
|
|
metacode.icon = metacode.icon.sub('generics_96px', 'generics/96px')
|
|
|
|
metacode.save
|
2016-01-20 02:18:22 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|