diff --git a/app/models/university/person.rb b/app/models/university/person.rb index 76d5fcf367fb9a3a017f9f76fcbf1f0616f8ac6d..1012cf47ee3c92aa95ccbceefa9db26ab417fb89 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -62,6 +62,11 @@ class University::Person < ApplicationRecord foreign_key: :author_id, dependent: :nullify + has_many :communication_website_imported_authors, + class_name: "Communiation::Website::Imported::Author", + foreign_key: :author_id, + dependent: :destroy + has_many :author_websites, -> { distinct }, through: :communication_website_posts, @@ -77,6 +82,7 @@ class University::Person < ApplicationRecord through: :education_programs, source: :websites + validates_presence_of :first_name, :last_name validates_uniqueness_of :email, scope: :university_id, diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 92c8711c75acdb429063d87f079fc6af79cfdf71..74fd771a4dd11959c7faf09d8fd0e33a318d465a 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -17,7 +17,7 @@ teachers: teachers_description: <% @program.teachers.includes(:person).ordered.each do |teacher| %> "<%= teacher.person.slug %>": > - <%= teacher.description %> + <%= teacher.description.blank? ? teacher.person.biography.to_plain_text : teacher.description %> <% end %> roles: <% @program.roles.ordered.each do |role| %> diff --git a/app/views/admin/education/schools/static.html.erb b/app/views/admin/education/schools/static.html.erb index 0cb0193c0fbba13d773e24de62c5066d6aa90dbe..60fcb4a93f1a5b8d950b41746ac1962bf53b711d 100644 --- a/app/views/admin/education/schools/static.html.erb +++ b/app/views/admin/education/schools/static.html.erb @@ -18,6 +18,6 @@ administrators: administrators_description: <% @school.administrators.includes(:person).ordered.each do |administrator| %> "<%= administrator.person.slug %>": > - <%= administrator.description %> + <%= administrator.description.blank? ? administrator.person.biography.to_plain_text : administrator.description %> <% end %> ---