parent
6f1d84eecc
commit
f0b6c04e5f
@ -1,6 +1,6 @@
|
|||||||
class ModifyPraisesCountForChallenges < ActiveRecord::Migration[5.2]
|
class ModifyPraisesCountForChallenges < ActiveRecord::Migration[5.2]
|
||||||
def change
|
def change
|
||||||
challenges = Challenge.where(nil).unscope
|
challenges = Challenge.where(nil).unscoped
|
||||||
challenges.find_each do |c|
|
challenges.find_each do |c|
|
||||||
praises_count = c.praise_tread.where(praise_or_tread: 1).count
|
praises_count = c.praise_tread.where(praise_or_tread: 1).count
|
||||||
c.update_column(:praises_count, praises_count)
|
c.update_column(:praises_count, praises_count)
|
Loading…
Reference in new issue