metamaps--metamaps/db/migrate/20151028061513_metacode_asset_path_update.rb

10 lines
310 B
Ruby
Raw Normal View History

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