commit
625a420583
@ -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