metamaps--metamaps/db/migrate/20160120061513_metacode_asset_path_update.rb
Devin Howard 7d4da81272 Update code style automatically using rubocop gem (#563)
* install rubocop

* 1961 automatic rubocop fixes

* update rubocop.yml to ignore half of the remaining cops

* rubocop lint warnings

* random other warnings fixed
2016-07-26 08:14:23 +08:00

14 lines
516 B
Ruby

class Metacode < ActiveRecord::Base
end
class MetacodeAssetPathUpdate < ActiveRecord::Migration
def change
Metacode.first(50).each do |metacode|
next unless metacode.icon.start_with?('/assets/icons/')
metacode.icon = metacode.icon.sub(/^\/assets\/icons/, 'https://s3.amazonaws.com/metamaps-assets/metacodes')
metacode.icon = metacode.icon.sub('blueprint_96px', 'blueprint/96px')
metacode.icon = metacode.icon.sub('generics_96px', 'generics/96px')
metacode.save
end
end
end