metamaps--metamaps/db/migrate/20151028061513_metacode_asset_path_update.rb
2015-11-06 17:08:42 +08:00

9 lines
310 B
Ruby

class MetacodeAssetPathUpdate < ActiveRecord::Migration
def change
Metacode.all.each do |metacode|
if metacode.icon.start_with?("/assets/icons/")
metacode.update(icon: metacode.icon.gsub(/^\/assets\/icons/, "https://s3.amazonaws.com/metamaps-assets/metacodes"))
end
end
end
end