first version of multi categories and tags

This commit is contained in:
Fu Matthew authored and chris committed 2013-02-27 10:49:48 +08:00
1 parent 4bc3a57862
commit 99e67c8719
12 files changed
+110 -11

No files matched your search

+19
View File
@@ -214,4 +214,23 @@ namespace :migrate do
end
end
task :convert_cate_tag_type => :environment do
[Page,PagePart].each do |obj|
obj.all.each do |pp|
if pp.category.blank?
pp.category = []
else
pp.category = [pp.category]
end
if pp.tag.blank?
pp.tag = []
else
pp.tag = [pp.tag]
end
pp.save
end
end
end
end