disable data transform when switching attribute field type. new member stable

This commit is contained in:
Matthew K. Fu JuYuan authored and chris committed 2012-11-22 21:10:35 +08:00
1 parent edf38644c9
commit 77386f0284
12 files changed
+174 -95

No files matched your search

+20 -1
View File
@@ -2,7 +2,26 @@
require 'resque_scheduler/tasks'
namespace :data_migration do
task :migrate_user_infos_from_1121 => :environment do
AttributeField.all.each do |af|
if af.has_attribute?('locale')
af.title_translations = case af[:locale]
when true
af[:locale_title]
when false
{af[:neutral_for] => af[:neutral_title]}
end
af.unset("locale")
af.unset("locale_title")
af.unset("neutral_for")
af.unset("neutral_title")
af.save
end
end
end
task :add_order_to_announcement_tag_0703 => :environment do
AnnouncementTag.first({conditions:{ key: 'students' }}).update_attributes(:order=>1)
AnnouncementTag.first({conditions:{ key: 'alumni' }}).update_attributes(:order=>2)