|
|
@ -23,7 +23,6 @@ namespace :subjects do
|
|
|
|
str << ("(#{subject.id}, #{study_count}, #{course_study_count}, #{initiative_study}, " +
|
|
|
|
str << ("(#{subject.id}, #{study_count}, #{course_study_count}, #{initiative_study}, " +
|
|
|
|
"#{data.passed_count}, #{data.course_used_count}, #{data.school_used_count}, " +
|
|
|
|
"#{data.passed_count}, #{data.course_used_count}, #{data.school_used_count}, " +
|
|
|
|
"'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')")
|
|
|
|
"'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')")
|
|
|
|
puts "index: #{index}; worker_number: #{Parallel.worker_number}"
|
|
|
|
|
|
|
|
puts "####str: #{str}"
|
|
|
|
puts "####str: #{str}"
|
|
|
|
if str.size == 50 || subject == s.last
|
|
|
|
if str.size == 50 || subject == s.last
|
|
|
|
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
|
|
|
|
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
|
|
|
|