diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index 50cce129cb2471cb63bbf389002961f2ef89202e..6749b6482fb3ae250b40d349c1da56673646dd0e 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -27,10 +27,10 @@ # fk_rails_... (university_id => universities.id) # class Communication::Website < ApplicationRecord - include WithGitRepository + include WithAbouts include WithGit + include WithGitRepository include WithHome - include WithAbouts include WithImport belongs_to :university diff --git a/app/models/university/person.rb b/app/models/university/person.rb index e5da3f416c45e2b8addd235bbdc87ce1e34e10de..68e34359fc032ad9180617412b1933c65b723c35 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -100,7 +100,14 @@ class University::Person < ApplicationRecord end def identifiers(website: nil) - [:static, :author, :researcher, :teacher, :administrator] + website_id = website&.id + list = [] + list << :author if communication_websites.pluck(:id).include?(website_id) + list << :researcher if research_websites.pluck(:id).include?(website_id) + list << :teacher if education_websites.pluck(:id).include?(website_id) + # TODO :administrator + list << :static unless list.empty? + list end def git_path_static