You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/lib/tasks/resource_publish.rake

11 lines
424 B

6 years ago
#coding=utf-8
namespace :resource_publish do
desc "start publish resource"
task :publish => :environment do
Rails.logger.info("log--------------------------------resource_publish start")
attachments = Attachment.where("publish_time < '#{Time.now}' and is_publish = 0")
6 years ago
attachments.update_all(is_publish: 1)
6 years ago
Rails.logger.info("log--------------------------------resource_publish end")
end
end