fix error

This commit is contained in:
邱博亞 2023-03-04 12:26:08 +08:00
parent 755d395902
commit 8c412dc167
2 changed files with 14 additions and 1 deletions

View File

@ -144,7 +144,7 @@ class PersonalJournalsController < ApplicationController
def index_by_author(journal_papers) def index_by_author(journal_papers)
journal_papers_total_pages = journal_papers.total_pages 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| jps_data = jps.collect do |jp|
{'title' => jp.create_link_tag_for_title} {'title' => jp.create_link_tag_for_title}
end end

View File

@ -211,6 +211,19 @@ class JournalPaper
plugin_datas plugin_datas
end 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) def get_plugin_field_data(field)
case field case field
when "level_type" when "level_type"