class ModifyKeContentsForMarkdown < ActiveRecord::Migration[5.2] # include ActionView::Helpers::SanitizeHelper def change # def ke_transform_to_md content # sanitize(content, tags: %w(img a span), attributes: %w(src href target style)) # .gsub(/^(\n)/, "").gsub(/(\n)+/, "
").gsub(/$(\n)/, "") # .gsub(/(\n)+/, "
").gsub("\t", "    ") # end # # MessageDetail.find_each do |m| # content = ke_transform_to_md m.content # puts("content:#{content}") # m.update_column(:content, content) # end end end