cirandas.net

ref: master

db/migrate/20160809123835_add_people_and_article_editor.rb


1
2
3
4
5
6
7
8
9
class AddPeopleAndArticleEditor < ActiveRecord::Migration
  def change
    add_column :profiles, :editor, :string, :null => false, :default => Article::Editor::TINY_MCE
    add_column :articles, :editor, :string, :null => false, :default => Article::Editor::TINY_MCE
    Article.where(:type => 'TextileArticle').update_all(:type => 'TextArticle', :editor => Article::Editor::TEXTILE)
    Article.where(:type => 'TinyMceArticle').update_all(:type => 'TextArticle', :editor => Article::Editor::TINY_MCE)
    Article.where(:type => 'RawHTMLArticle').update_all(:type => 'TextArticle', :editor => Article::Editor::RAW_HTML)
  end
end