Merge branch 'ntu' of github.com:Rulingcom/orbit into ntu

Conflicts:
	lib/tasks/migrate.rake
This commit is contained in:
Fu Matthew committed 2013-01-03 19:41:52 +08:00
commit 39f715319b
6 files changed
+127 -118

No files matched your search

+16
View File
@@ -350,10 +350,26 @@ namespace :migrate do
ModuleApp.new.from_json(File.open("#{Rails.root}/vendor/built_in_modules/gallery/gallery.json").read).save
end
task :make_default_widget_work_config => :environment do
a = ModuleApp.where(:key=>'announcement').first
a.widgets[:default_widget] = ['typeA','typeC','typeB_style2','typeB_style3','typeB_style4']
a.widget_fields = ["title","bulletin_category","postdate"]
a.save
end
task :reorder_items => :environment do
reorder_children(Item.root)
end
def reorder_children(parent)
parent.children.each_with_index do |child, i|
child.position = i
child.save
reorder_children(child) if child.children
end
end
end