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.
|
#coding=utf-8
|
|
namespace :course do
|
|
desc "course end"
|
|
task :end => :environment do
|
|
courses = Course.where("end_date <= '#{Date.today}' and is_end = 0")
|
|
courses.each do |course|
|
|
course.update_attribute(:is_end, 1)
|
|
end
|
|
end
|
|
end |