From d890e01aed72130a6d67aa99a257f3c22035a9e1 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 19 Apr 2023 20:12:29 +0800 Subject: [PATCH] =?UTF-8?q?commit=E6=8F=90=E5=8F=96=E8=B4=A1=E7=8C=AE?= =?UTF-8?q?=E8=80=85=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/batch_add_contributors.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/batch_add_contributors.rake b/lib/tasks/batch_add_contributors.rake index 4da743434..e1a5c44e6 100644 --- a/lib/tasks/batch_add_contributors.rake +++ b/lib/tasks/batch_add_contributors.rake @@ -1,5 +1,5 @@ namespace :batch_add_contributors do - desc "commit_log_to_db" + desc "batch_add_contributors" task done: :environment do puts "project_id=================#{ENV['project_id']}" return if ENV['project_id'].blank? @@ -42,7 +42,7 @@ namespace :batch_add_contributors do sql_connection = ActiveRecord::Base.connection sql_connection.begin_db_transaction if Issue.find_by_sql("select id from commit_contributors where name='#{commiter['email']}'").present? - sql = "update commit_contributors set created_at ='#{}' where name='#{commiter['email']}'" + sql = "update commit_contributors set created_at ='#{commit_date_str}' where name='#{commiter['email']}'" else sql = "INSERT INTO commit_contributors (`created_at`, `count`, `name`) VALUES ('#{commit_date_str}',1,'#{commiter['email']}')" end @@ -92,7 +92,7 @@ namespace :batch_add_contributors do sql_connection = ActiveRecord::Base.connection sql_connection.begin_db_transaction if Issue.find_by_sql("select id from commit_contributors where name='#{commiter['email']}'").present? - sql = "update commit_contributors set created_at ='#{}' where name='#{commiter['email']}'" + sql = "update commit_contributors set created_at ='#{commit_date_str}' where name='#{commiter['email']}'" else sql = "INSERT INTO commit_contributors (`created_at`, `count`, `name`) VALUES ('#{commit_date_str}',1,'#{commiter['email']}')" end