From 38e3b5fb77474c26b6b7b172f97aee10c9199db8 Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 16 Dec 2021 10:24:39 +0800 Subject: [PATCH] Fix bug. --- app/helpers/admin/personal_books_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/admin/personal_books_helper.rb b/app/helpers/admin/personal_books_helper.rb index 1628334..12e1111 100644 --- a/app/helpers/admin/personal_books_helper.rb +++ b/app/helpers/admin/personal_books_helper.rb @@ -5,7 +5,7 @@ module Admin::PersonalBooksHelper split_text = split_text.nil? ? '/' : split_text[0] full_authors_names = get_member(book).collect(&:name) if authors_text.present? - authors_names = authors_text.split(split_text).select{|a| !(full_authors_names.include?(full_authors_names))} + authors_names = authors_text.split(split_text).select{|a| !(full_authors_names.include?(a.strip()))} full_authors_names += authors_names end full_authors_names.join(split_text) @@ -21,7 +21,7 @@ module Admin::PersonalBooksHelper "#{member_name}" } if authors_text.present? - authors_names = authors_text.split(split_text).select{|a| !(full_authors_names.include?(full_authors_names.strip()))} + authors_names = authors_text.split(split_text).select{|a| !(full_authors_names.include?(a.strip()))} full_authors += authors_names end full_authors.join(split_text)