资源发布失败测试

This commit is contained in:
cxt 2016-10-14 16:17:00 +08:00
parent 2d508254ac
commit 0a9b6bcdbc
1 changed files with 2 additions and 2 deletions

View File

@ -3,9 +3,9 @@
namespace :resource_publish do namespace :resource_publish do
desc "start publish resource" desc "start publish resource"
task :publish => :environment do task :publish => :environment do
attachments = Attachment.where("publish_time = '#{Date.today}'") attachments = Attachment.where("publish_time <= '#{Date.today}'")
attachments.each do |attachment| attachments.each do |attachment|
attachment.update_column('is_publish', 1) attachment.update_column('is_publish', 1) if attachment.is_publish == 0
end end
end end
end end