Set default formats in the database now that rails handles enums

Because rails now reads the defaults from the database correctly it
no longer works to set them conditionally in after_initialise as they
have already been set.
This commit is contained in:
Tom Hughes 2015-01-10 15:34:03 +00:00
parent a9a9ae2cbb
commit 8fa9763281
8 changed files with 24 additions and 42 deletions

View file

@ -0,0 +1,17 @@
class ChangeDefaultFormats < ActiveRecord::Migration
def up
change_column_default :diary_entries, :body_format, "markdown"
change_column_default :diary_comments, :body_format, "markdown"
change_column_default :messages, :body_format, "markdown"
change_column_default :users, :description_format, "markdown"
change_column_default :user_blocks, :reason_format, "markdown"
end
def down
change_column_default :diary_entries, :body_format, "html"
change_column_default :diary_comments, :body_format, "html"
change_column_default :messages, :body_format, "html"
change_column_default :users, :description_format, "html"
change_column_default :user_blocks, :reason_format, "html"
end
end