From 758541250f73ee6e8f2d3fb671f3a16eb7941c15 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 25 Jul 2014 15:41:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=95=B0=E6=8D=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E6=95=B0=E6=8D=AE=E5=BA=93=E6=95=B0=E6=8D=AE=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20140725073357_insert_to_setting.rb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 db/migrate/20140725073357_insert_to_setting.rb 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