diff --git a/db/migrate/20140725073357_insert_to_setting.rb b/db/migrate/20140725073357_insert_to_setting.rb new file mode 100644 index 000000000..89c367a7d --- /dev/null +++ b/db/migrate/20140725073357_insert_to_setting.rb @@ -0,0 +1,28 @@ +class InsertToSetting < ActiveRecord::Migration + def up + ss = Setting.find_all_by_name("plugin_redmine_ckeditor") + if ss.nil? + sett = Setting.new + sett.name = "plugin_redmine_ckeditor" + sett.value = "--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess + skin: kama + ui_color: ! '#f4f4f4' + width: '' + height: '400' + enter_mode: '1' + show_blocks: '1' + toolbar_can_collapse: '0' + toolbar_location: top + toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll" + sett.save + end + end + + def down + ss = Setting.find_all_by_name("plugin_redmine_ckeditor") + if ss.nil? + else + ss.destroy + end + end +end