From 0a9b6bcdbc8ca50db7917b27531fd3db9c7b54bf Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 14 Oct 2016 16:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=8F=91=E5=B8=83=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/resource_publish.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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