dev_auth
cxt 5 years ago
parent 8d667dcf9c
commit e0ed4f2b52

@ -3,7 +3,7 @@ class MigrateChartRule < ActiveRecord::Migration[5.2]
ChartRule.all.each do |rule| ChartRule.all.each do |rule|
if rule.competition if rule.competition
com_module = rule.competition.competition_modules.find_by(module_type: "chart") com_module = rule.competition.competition_modules.find_by(module_type: "chart")
if com_module if com_module && !com_module.competition_module_md_contents.exists?(competition_stage_id: rule.competition_stage_id ? rule.competition_stage_id : 0)
CompetitionModuleMdContent.create!(content: rule.content, competition_module_id: com_module.id, competition_stage_id: rule.competition_stage_id ? rule.competition_stage_id : 0) CompetitionModuleMdContent.create!(content: rule.content, competition_module_id: com_module.id, competition_stage_id: rule.competition_stage_id ? rule.competition_stage_id : 0)
end end
end end

Loading…
Cancel
Save