migrate metacodes that started with /assets/icons to use amazonaws urls. Remove last migration I made
This commit is contained in:
parent
6e79b58e16
commit
ddce6ad95c
2 changed files with 10 additions and 8 deletions
|
@ -1,8 +0,0 @@
|
||||||
class RemoveAssetPathsFromMetacodes < ActiveRecord::Migration
|
|
||||||
def change
|
|
||||||
Metacode.all.each do |metacode|
|
|
||||||
metacode.icon = metacode.icon.gsub(/^\/assets\//, '')
|
|
||||||
metacode.save
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
10
db/migrate/20151028061513_metacode_asset_path_update.rb
Normal file
10
db/migrate/20151028061513_metacode_asset_path_update.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
class MetacodeAssetPathUpdate < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
Metacode.all.each do |metacode|
|
||||||
|
if metacode.icon.start_with?("/assets/icons/")
|
||||||
|
metacode.icon = metacode.icon.gsub(/^\/assets\/icons/, "https://s3.amazonaws.com/metamaps-assets/metacodes")
|
||||||
|
metacode.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue