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