diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb index b187ee1dc2afc4fef05edd48f1a0d0bb245d06f4..6f227728cd853220b83e747ab96e673f3f656c62 100644 --- a/app/models/communication/extranet.rb +++ b/app/models/communication/extranet.rb @@ -104,11 +104,19 @@ class Communication::Extranet < ApplicationRecord alias academic_years years def organizations - about&.alumni_organizations || connected_organizations + if about.present? && about.respond_to?(:alumni_organizations) + about.alumni_organizations + else + connected_organizations + end end def experiences - about&.alumni_experiences + if about.present? && about.respond_to?(:alumni_experiences) + about.alumni_experiences + else + experiences_through_connections + end end def url diff --git a/app/models/communication/extranet/with_connections.rb b/app/models/communication/extranet/with_connections.rb index 67841e9235ab6d571a83acd50aa0c5dbb50ac225..1325bfcec6c8751760fa94ad125c951a992930e5 100644 --- a/app/models/communication/extranet/with_connections.rb +++ b/app/models/communication/extranet/with_connections.rb @@ -27,4 +27,8 @@ module Communication::Extranet::WithConnections University::Person.where(id: ids) end + def experiences_through_connections + University::Person::Experience.where(person_id: connected_persons, organization_id: connected_organizations) + end + end \ No newline at end of file