051_fix_canonical_server_url.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:0k
源码类别:
Ajax
开发平台:
Others
- class FixCanonicalServerUrl < ActiveRecord::Migration
- class Blog < ActiveRecord::Base
- include BareMigration
- serialize :settings, Hash
- end
- def self.up
- unless $schema_generator
- Blog.find(:all).each do |b|
- b.settings['canonical_server_url'] = b.settings['canonical_server_url'].to_s.gsub(%r{/$},'')
- b.save
- end
- end
- end
- def self.down
- end
- end