Merge branch 'ntu' of github.com:Rulingcom/orbit into ntu
Conflicts: lib/tasks/migrate.rake
This commit is contained in:
commit
39f715319b
6 files changed
+127
-118
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user