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/course_end.rake

10 lines
256 B

#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