Add data migration for search widget for news and announcement.
This commit is contained in:
parent
f9bdb4a327
commit
834fcddc52
|
@ -19,4 +19,14 @@ namespace :data_migration do
|
||||||
NewsBulletinCategory.all.each{|bc| bc.disable=false;bc.save!}
|
NewsBulletinCategory.all.each{|bc| bc.disable=false;bc.save!}
|
||||||
end
|
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
|
end
|
Loading…
Reference in New Issue