From 9c704a9bbb47462df3c01a5d1cf5c95e09c8882c Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Wed, 16 Feb 2022 16:08:03 +0100 Subject: [PATCH] fix --- app/models/communication/website/with_abouts.rb | 6 +++--- app/models/education/school.rb | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/communication/website/with_abouts.rb b/app/models/communication/website/with_abouts.rb index f8951f2e2..556203472 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 092cee5da..924d1a25b 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 -- GitLab