资源发布失败测试
This commit is contained in:
parent
2d508254ac
commit
0a9b6bcdbc
|
@ -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
|
Loading…
Reference in New Issue