parent
00a41cd078
commit
ac53a95780
@ -0,0 +1,10 @@
|
|||||||
|
class ModifyChallnegeScoreForChoose < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
challenges = Challenge.where(st: 1)
|
||||||
|
challenges.find_each do |c|
|
||||||
|
puts(c.id)
|
||||||
|
score = c.challenge_chooses.sum(:score)
|
||||||
|
c.update_column(:score, score)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue