From 536b9afcf97e10605e325da64d11b736975e7459 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 13 Feb 2020 14:37:23 +0800 Subject: [PATCH] 1 --- lib/tasks/statistic_subject_info.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/statistic_subject_info.rake b/lib/tasks/statistic_subject_info.rake index f8784d8fe..363570d18 100644 --- a/lib/tasks/statistic_subject_info.rake +++ b/lib/tasks/statistic_subject_info.rake @@ -9,9 +9,9 @@ namespace :subjects do "school_used_count, created_at, updated_at" subjects.find_in_batches(batch_size: 50) do |s| Parallel.each_with_index(s, in_processes: 4) do |subject, index| - if subject == s.first - buffer_size == 0 - str == "" + if defined?(buffer_size).nil? + buffer_size = 0 + str = "" end buffer_size += 1 str += ", " unless str.empty?