From 834fcddc521ef52de7ea0d3e05abfe5ff68746ff Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Fri, 20 Jul 2012 16:30:43 +0800 Subject: [PATCH] Add data migration for search widget for news and announcement. --- lib/tasks/data_migration.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tasks/data_migration.rake b/lib/tasks/data_migration.rake index ff132c4a..98b3dd3e 100644 --- a/lib/tasks/data_migration.rake +++ b/lib/tasks/data_migration.rake @@ -19,4 +19,14 @@ namespace :data_migration do NewsBulletinCategory.all.each{|bc| bc.disable=false;bc.save!} end + task :add_search_widget_to_news_and_announcement => :environment do + app = ModuleApp.first({:conditions=>{:title => 'news'}}) + app.widgets << "bulletins_search_block" if app.widgets.include?("bulletins_search_block") + app.save! + app = ModuleApp.first({:conditions=>{:title => 'Announcement'}}) + app.widgets << "news_bulletins_search_block" if app.widgets.include?("news_bulletins_search_block") + app.save! + p "==DO NOT FORGET TO RUN: rake redis_search:index" + end + end \ No newline at end of file