migrate metacodes that started with /assets/icons to use amazonaws urls. Remove last migration I made
This commit is contained in:
parent
d8da2d93fd
commit
d99ed6b627
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