metamaps--metamaps/db/migrate/20151028061513_metacode_asset_path_update.rb
2015-12-03 16:57:30 -05: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