diff --git a/lib/tasks/resource_publish.rake b/lib/tasks/resource_publish.rake index 2df0c6145..df8fefda1 100644 --- a/lib/tasks/resource_publish.rake +++ b/lib/tasks/resource_publish.rake @@ -3,9 +3,9 @@ namespace :resource_publish do desc "start publish resource" task :publish => :environment do - attachments = Attachment.where("publish_time = '#{Date.today}'") + attachments = Attachment.where("publish_time <= '#{Date.today}'") attachments.each do |attachment| - attachment.update_column('is_publish', 1) + attachment.update_column('is_publish', 1) if attachment.is_publish == 0 end end end \ No newline at end of file