mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 05:35:46 +08:00
新增:修复数据rake任务
This commit is contained in:
@@ -20,10 +20,25 @@ class IssueStatus < ApplicationRecord
|
||||
ADD = 1
|
||||
SOLVING = 2
|
||||
SOLVED = 3
|
||||
FEEDBACK = 4
|
||||
# FEEDBACK = 4
|
||||
CLOSED = 5
|
||||
REJECTED = 6
|
||||
|
||||
has_many :issues
|
||||
belongs_to :project, optional: true
|
||||
|
||||
def self.init_data
|
||||
map = {
|
||||
"1" => "新增",
|
||||
"2" => "正在解决",
|
||||
"3" => "已解决",
|
||||
"5" => "关闭",
|
||||
"6" => "拒绝"
|
||||
}
|
||||
IssueStatus.order(id: :asc).each do |stat|
|
||||
next if map[stat.id] == stat.name
|
||||
Issue.where(status_id: stat.id).each{|i| i.update_column(:status_id, 1)}
|
||||
stat.destroy!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user