From f370e1906e35f2356757f73be5365e4e577d9cc5 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 14:28:58 +0800 Subject: [PATCH] =?UTF-8?q?rake=20commit=5Flog=5Fto=5Fdb=20=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=8D=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/commit_log_to_db.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/commit_log_to_db.rake b/lib/tasks/commit_log_to_db.rake index 6d1c854ea..ae80f9424 100644 --- a/lib/tasks/commit_log_to_db.rake +++ b/lib/tasks/commit_log_to_db.rake @@ -25,9 +25,9 @@ namespace :commit_log_to_db do commit_author = "#{commiter['name']} <#{commiter['email']}>" commit_sha = commit['sha'] ref = "master" - commit_message = commit['commit']['message'].to_s.gsub("/n","") + commit_message = commit['commit']['message'].to_s.gsub("\"","") user = User.find_by(mail: commiter['email']) - user_id = user&.id || 1 + user_id = user&.id || project.user_id commit_date = Time.parse(commit['commit']['author']['date']) commit_date_str = commit_date.strftime("%a %b %d %H:%M:%S") @@ -60,9 +60,9 @@ namespace :commit_log_to_db do commit_author = "#{commiter['name']} <#{commiter['email']}>" commit_sha = commit['sha'] ref = "master" - commit_message = commit['commit']['message'].to_s.gsub("/n","") + commit_message = commit['commit']['message'].to_s.gsub("/n","").gsub("\"","") user = User.find_by(mail: commiter['email']) - user_id = user&.id || 1 + user_id = user&.id || project.user_id commit_date = Time.parse(commit['commit']['author']['date']) commit_date_str = commit_date.strftime("%Y-%m-%d %H:%M:%S")