From 8c412dc167f23ddcbdaa552df5ec5a31337054fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 4 Mar 2023 12:26:08 +0800 Subject: [PATCH] fix error --- app/controllers/personal_journals_controller.rb | 2 +- app/models/journal_paper.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 53c0e60..adddfe0 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -144,7 +144,7 @@ class PersonalJournalsController < ApplicationController def index_by_author(journal_papers) journal_papers_total_pages = journal_papers.total_pages - journal_papers_list = journal_papers.group_by{|jp| jp.member_profile.name rescue jp.authors}.collect do |name, jps| + journal_papers_list = journal_papers.group_by{|jp| jp.member_profiles.collect{|v| v.name}.join(', ') rescue jp.authors}.collect do |name, jps| jps_data = jps.collect do |jp| {'title' => jp.create_link_tag_for_title} end diff --git a/app/models/journal_paper.rb b/app/models/journal_paper.rb index 0059b22..e8cd8cb 100644 --- a/app/models/journal_paper.rb +++ b/app/models/journal_paper.rb @@ -211,6 +211,19 @@ class JournalPaper plugin_datas end + def member_profile(only_one=true) + tmp = super() + only_one ? tmp.first : tmp + end + + def member_profiles + member_profile(false) + end + + def member_profile=(mp) + super(mp.class != MemberProfile ? mp : [mp]) + end + def get_plugin_field_data(field) case field when "level_type"