修改部分项目讨论区描述仍为课程讨论区的描述

This commit is contained in:
sw 2014-08-01 14:37:44 +08:00
parent 9e5f7e6fc6
commit aa0caff077
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# -*coding:utf-8 -*-
class ChangeBoardsName < ActiveRecord::Migration
def up
boards = Board.where("project_id <> -1 and name like '%课程讨论区%'")
boards.each do |board|
board.name = "项目讨论区"
board.description = "项目讨论区"
board.save(:validate => false)
end
end
def down
boards = Board.where("project_id <> -1 and name like '%项目讨论区%'")
boards.each do |board|
board.name = " 课程讨论区"
board.description = " 课程讨论区"
board.save(:validate => false)
end
end
end