rake中加打印日志
This commit is contained in:
parent
f2f9792203
commit
5aab3fdb75
|
@ -3,6 +3,7 @@
|
|||
namespace :homework_publishtime do
|
||||
desc "start publish homework and end homework"
|
||||
task :publish => :environment do
|
||||
puts "--------------------------------homework_publish start"
|
||||
homework_commons = HomeworkCommon.where("publish_time = '#{Date.today}'")
|
||||
homework_commons.each do |homework|
|
||||
homework_detail_manual = homework.homework_detail_manual
|
||||
|
@ -35,6 +36,7 @@ namespace :homework_publishtime do
|
|||
Mailer.run.homework_added(homework)
|
||||
end
|
||||
end
|
||||
puts "--------------------------------homework_publish end"
|
||||
end
|
||||
|
||||
task :end => :environment do
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
namespace :resource_publish do
|
||||
desc "start publish resource"
|
||||
task :publish => :environment do
|
||||
puts "--------------------------------resource_publish start"
|
||||
attachments = Attachment.where("publish_time = '#{Date.today}'")
|
||||
attachments.each do |attachment|
|
||||
attachment.update_column('is_publish', 1)
|
||||
end
|
||||
puts "--------------------------------resource_publish end"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue