|
|
|
@ -0,0 +1,13 @@
|
|
|
|
|
class Modify1WechatSupportForShixuns < ActiveRecord::Migration[5.2]
|
|
|
|
|
def change
|
|
|
|
|
shixuns = Shixun.joins(:challenges).where(is_wechat_support: true)
|
|
|
|
|
.select("shixuns.*, challenges.path path")
|
|
|
|
|
shixuns.each do |shixun|
|
|
|
|
|
if shixun.path.split(";").count > 1
|
|
|
|
|
shixun.update_attribute(:is_wechat_support, false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Shixun.joins(:challenges).where(challenges: {st: 1}).update_all(is_wechat_support: false)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|