dev_video
daiao 5 years ago
parent cd4f0ac2a4
commit ce9d8ee400

@ -1,9 +1,9 @@
class Modify1WechatSupportForShixuns < ActiveRecord::Migration[5.2] class Modify1WechatSupportForShixuns < ActiveRecord::Migration[5.2]
def change 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") .select("shixuns.*, challenges.path path")
shixuns.each do |shixun| 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) shixun.update_attribute(:is_wechat_support, false)
end end
end end

Loading…
Cancel
Save