过滤小程序镜像

dev_video
daiao 5 years ago
parent ce1ac4d838
commit 98e58ed589

@ -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
Loading…
Cancel
Save