From ca16904b1fe76e7c9350f99990cb307636880bee Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 15 May 2020 19:04:44 +0800 Subject: [PATCH] fix error --- app/models/patent.rb | 3 +++ app/views/plugin/personal_patent/_profile.html.erb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/patent.rb b/app/models/patent.rb index c6760f7..d5c7ad2 100644 --- a/app/models/patent.rb +++ b/app/models/patent.rb @@ -36,6 +36,9 @@ class Patent scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :application_date => "desc", :publish_date => "desc") } + def member_profile(): + super || (MemberProfile.find(self.member_profile_id) rescue nil) + end def get_plugin_data(fields_to_show) plugin_datas = [] fields_to_show.each do |field| diff --git a/app/views/plugin/personal_patent/_profile.html.erb b/app/views/plugin/personal_patent/_profile.html.erb index 767e286..410bcae 100644 --- a/app/views/plugin/personal_patent/_profile.html.erb +++ b/app/views/plugin/personal_patent/_profile.html.erb @@ -57,7 +57,7 @@ <%= patent.patent_no %> <%= patent.patent_country %> - <%= patent.member_profile.name %> + <%= Array(patent.member_profile).collect{|v| v.name}.join(' / ') %> <% end %>