Commit 6a0b8035be1cef1b8f9d9555f4d9befb7ebde3f3
1 parent
6949b704
Exists in
master
and in
2 other branches
Change layout template
Showing
1 changed file
with
19 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | +class ChangeSoftwareLayout < ActiveRecord::Migration | |
| 2 | + def up | |
| 3 | + softwares = SoftwareInfo.all | |
| 4 | + softwares.each do |software| | |
| 5 | + software.community.layout_template = "lefttopright" | |
| 6 | + print "." if software.community.save | |
| 7 | + boxToMove = software.community.boxes.where(:position => 1).first | |
| 8 | + blockToMove = boxToMove.blocks.where(:type => "SoftwareInformationBlock").first | |
| 9 | + if blockToMove | |
| 10 | + newBox = software.community.boxes.where(:position => 4).first | |
| 11 | + blockToMove.box = newBox | |
| 12 | + print "." if blockToMove.save | |
| 13 | + end | |
| 14 | + end | |
| 15 | + end | |
| 16 | + | |
| 17 | + def down | |
| 18 | + end | |
| 19 | +end | ... | ... |