From 45adef9eac93ce1673eba12d1baad9a0fa2200bc Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Tue, 3 Oct 2023 21:12:42 +0800 Subject: [PATCH] Fix author text bug. --- app/helpers/admin/personal_conferences_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/admin/personal_conferences_helper.rb b/app/helpers/admin/personal_conferences_helper.rb index 0462438..71f72c9 100644 --- a/app/helpers/admin/personal_conferences_helper.rb +++ b/app/helpers/admin/personal_conferences_helper.rb @@ -10,7 +10,7 @@ module Admin::PersonalConferencesHelper end full_authors_names = get_member(writing_conference).collect do |member| member_name = member.name - idx = authors_names.index{|a| a.chomp('*') == member_name} + idx = authors_names.index{|a| a.match(/(^|[ \(\[])#{member_name}([ \)\]\*]|$)/)} if idx member_name = authors_names[idx] authors_names[idx] = nil @@ -31,7 +31,7 @@ module Admin::PersonalConferencesHelper end full_authors = get_member(writing_conference).collect do |member| member_name = member.name - idx = authors_names.index{|a| a.chomp('*') == member_name} + idx = authors_names.index{|a| a.match(/(^|[ \(\[])#{member_name}([ \)\]\*]|$)/)} if idx member_name = authors_names[idx] authors_names[idx] = nil