fix(messages): migrate message bodys to richtext
This commit is contained in:
parent
49a04b226c
commit
25d4efa71a
2 changed files with 11 additions and 2 deletions
|
|
@ -0,0 +1,10 @@
|
|||
class MigrateMessageBodyToActionText < ActiveRecord::Migration[7.0]
|
||||
include ActionView::Helpers::TextHelper
|
||||
def change
|
||||
rename_column :messages, :body, :body_old
|
||||
Message.all.each do |message|
|
||||
message.update_attribute(:body, simple_format(message.body_old))
|
||||
end
|
||||
remove_column :messages, :body_old
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue