From 63158ad9b3c56a52e34e0e481f1b45de934e5e31 Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 20 Jan 2024 01:49:14 +0000 Subject: [PATCH] fix sync for email with @yahoo.com.tw --- lib/tasks/sync_asia_personal_data_tasks.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/sync_asia_personal_data_tasks.rake b/lib/tasks/sync_asia_personal_data_tasks.rake index f0b03f3..73ffec3 100644 --- a/lib/tasks/sync_asia_personal_data_tasks.rake +++ b/lib/tasks/sync_asia_personal_data_tasks.rake @@ -42,7 +42,8 @@ module AsiaSyncPlugin #待確認: 指導論文(可用個人研究製作) paper_data def self.user_id(member) - user_id = member.email.sub(/@asia\.edu\.tw$/, '') + user_id_match = member.email.match(/(.*)@asia\.edu\.tw/) + user_id = user_id_match ? user_id_match[1] : nil end def self.localize_data(data) in_use_locales = Site.first.in_use_locales rescue [:en,:zh_tw]