diff --git a/app/models/communication/website/with_abouts.rb b/app/models/communication/website/with_abouts.rb index f8951f2e2e76454a120f73c961d208bcd471a6ae..556203472bbeb2e397d3a92968723b2ac9c96f72 100644 --- a/app/models/communication/website/with_abouts.rb +++ b/app/models/communication/website/with_abouts.rb @@ -70,9 +70,9 @@ module Communication::Website::WithAbouts @people ||= begin people = authors if about_school? - people += about&.university_people_through_role_involvements - people += about&.university_people_through_program_involvements - people += about&.university_people_through_program_role_involvements + people += about.university_people_through_role_involvements + people += about.university_people_through_program_involvements + people += about.university_people_through_program_role_involvements elsif about_journal? people += about.people end diff --git a/app/models/education/school.rb b/app/models/education/school.rb index 092cee5da2786100bc3900340c977e379615aa87..924d1a25be74e002d6db16489742e17a05a276a1 100644 --- a/app/models/education/school.rb +++ b/app/models/education/school.rb @@ -26,6 +26,11 @@ class Education::School < ApplicationRecord include WithGit + has_and_belongs_to_many :programs, + class_name: 'Education::Program', + join_table: 'education_programs_schools', + foreign_key: 'education_school_id', + association_foreign_key: 'education_program_id' belongs_to :university has_many :websites, class_name: 'Communication::Website', @@ -47,11 +52,6 @@ class Education::School < ApplicationRecord has_many :university_people_through_program_role_involvements, through: :programs, source: :university_people_through_role_involvements - has_and_belongs_to_many :programs, - class_name: 'Education::Program', - join_table: 'education_programs_schools', - foreign_key: 'education_school_id', - association_foreign_key: 'education_program_id' validates :name, :address, :city, :zipcode, :country, presence: true