Remove news and fix default_url in ImageUploader
This commit is contained in:
1 parent
0d26f48c9a
commit
475642d375
163 files changed
+46
-8582
No files matched your search
@@ -19,10 +19,7 @@ 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 << "news_bulletins_search_block" if !app.widgets.include?("news_bulletins_search_block")
|
||||
app.save!
|
||||
task :add_search_widget_to_announcement => :environment do
|
||||
app = ModuleApp.first({:conditions=>{:title => 'Announcement'}})
|
||||
app.widgets << "bulletins_search_block" if !app.widgets.include?("bulletins_search_block")
|
||||
app.save!
|
||||
|
||||
@@ -81,69 +81,6 @@ namespace :migrate do
|
||||
p '====================================================='
|
||||
p '====================================================='
|
||||
|
||||
p 'Start NewsBulletin'
|
||||
news_bulletins = NewsBulletin.admin_manager_all
|
||||
i = 1
|
||||
news_bulletins.each do |news_bulletin|
|
||||
p "#{i}/#{news_bulletins.size} - #{news_bulletin.id}"
|
||||
title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => news_bulletin.id, :language_value_type => news_bulletin.class})
|
||||
news_bulletin.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
|
||||
subtitle = I18nVariable.first(:conditions => {:key => 'subtitle', :language_value_id => news_bulletin.id, :language_value_type => news_bulletin.class})
|
||||
news_bulletin.subtitle_translations = {'en' => subtitle['en'], 'zh_tw' => subtitle['zh_tw']} if subtitle
|
||||
text = I18nVariable.first(:conditions => {:key => 'text', :language_value_id => news_bulletin.id, :language_value_type => news_bulletin.class})
|
||||
news_bulletin.text_translations = {'en' => text['en'], 'zh_tw' => text['zh_tw']} if text
|
||||
p news_bulletin.save(:validate => false)
|
||||
i += 1
|
||||
end
|
||||
p 'End NewsBulletin'
|
||||
|
||||
p '====================================================='
|
||||
|
||||
p 'Start NewsBulletinCategory'
|
||||
categories = NewsBulletinCategory.admin_manager_all
|
||||
i = 1
|
||||
categories.each do |category|
|
||||
p "#{i}/#{categories.size} - #{category.id}"
|
||||
title = I18nVariable.first(:conditions => {:language_value_id => category.id, :language_value_type => category.class})
|
||||
category.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
|
||||
p category.save(:validate => false)
|
||||
i += 1
|
||||
end
|
||||
p 'End NewsBulletinCategory'
|
||||
|
||||
p '====================================================='
|
||||
|
||||
p 'Start NewsBulletinFile'
|
||||
files = NewsBulletinFile.all
|
||||
i = 1
|
||||
files.each do |file|
|
||||
p "#{i}/#{files.size} - #{file.id}"
|
||||
description = I18nVariable.first(:conditions => {:language_value_id => file.id, :language_value_type => file.class})
|
||||
file.description_translations = {'en' => description['en'], 'zh_tw' => description['zh_tw']} if description
|
||||
title = I18nVariable.first(:conditions => {:language_value_id => file.id, :language_value_type => file.class})
|
||||
file.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
|
||||
p file.save(:validate => false)
|
||||
i += 1
|
||||
end
|
||||
p 'End NewsBulletinFile'
|
||||
|
||||
p '====================================================='
|
||||
|
||||
p 'Start NewsBulletinLink'
|
||||
links = NewsBulletinLink.all
|
||||
i = 1
|
||||
links.each do |link|
|
||||
p "#{i}/#{links.size} - #{link.id}"
|
||||
title = I18nVariable.first(:conditions => {:language_value_id => link.id, :language_value_type => link.class})
|
||||
link.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
|
||||
p link.save(:validate => false)
|
||||
i += 1
|
||||
end
|
||||
p 'End NewsBulletinLink'
|
||||
|
||||
p '====================================================='
|
||||
p '====================================================='
|
||||
|
||||
p 'Start PageContext'
|
||||
page_contexts = PageContext.all
|
||||
i = 1
|
||||
|
||||
Reference in new issue
Block a user