作业发布的rake

This commit is contained in:
cxt 2016-10-14 20:31:42 +08:00
parent 5870c3eaaf
commit 13b1d7bb78
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ namespace :homework_publishtime do
if str != ""
str += ","
end
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{Time.now}', '#{Time.now}')"
end
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
ActiveRecord::Base.connection.execute sql