|
|
|
@ -23,7 +23,7 @@ namespace :subjects do
|
|
|
|
|
"#{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')}')")
|
|
|
|
|
buffer_size += 1
|
|
|
|
|
puts "buffer_size: #{buffer_size}; subject_id: #{subject.id}; subject: #{subject == s.last}; index:#{index+1}"
|
|
|
|
|
puts "buffer_size: #{buffer_size}; subject_id: #{subject.id}; subject: #{subject == s.last};"
|
|
|
|
|
if buffer_size == 1000 || subject == s.last
|
|
|
|
|
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str}"
|
|
|
|
|
puts sql
|
|
|
|
|