资源的定时发布
This commit is contained in:
parent
d7500d1cc5
commit
6b4be999ee
|
@ -0,0 +1,11 @@
|
|||
#coding=utf-8
|
||||
|
||||
namespace :resource_publish do
|
||||
desc "start publish resource"
|
||||
task :publish => :environment do
|
||||
attachments = Attachment.where("publish_time = '#{Date.today}'")
|
||||
attachments.each do |attachment|
|
||||
attachment.update_column('is_publish', 1)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue