From 8d685b763fc565f1eb6b38e247535a01a77df5cc Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Wed, 19 Oct 2022 10:38:03 +0200
Subject: [PATCH] alumni

---
 .../admin/communication/extranets_controller.rb  |  8 ++++----
 app/models/communication/extranet.rb             | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/app/controllers/admin/communication/extranets_controller.rb b/app/controllers/admin/communication/extranets_controller.rb
index 04eb9d832..2a1123239 100644
--- a/app/controllers/admin/communication/extranets_controller.rb
+++ b/app/controllers/admin/communication/extranets_controller.rb
@@ -13,10 +13,10 @@ class Admin::Communication::ExtranetsController < Admin::Communication::Applicat
 
   def show
     @about = @extranet.about
-    @alumni = @about&.alumni
-    @cohorts = @about&.cohorts
-    @years = @about&.academic_years
-    @organizations = @about&.alumni_organizations
+    @alumni = @extranet.alumni
+    @cohorts = @extranet.cohorts
+    @years = @extranet.years
+    @organizations = @extranet.organizations
     breadcrumb
   end
 
diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb
index eb5cb55bc..01b34fd10 100644
--- a/app/models/communication/extranet.rb
+++ b/app/models/communication/extranet.rb
@@ -48,6 +48,22 @@ class Communication::Extranet < ApplicationRecord
     about.programs.many?
   end
 
+  def alumni
+    about&.university_person_alumni
+  end
+
+  def cohorts
+    about&.cohorts
+  end
+
+  def years
+    about&.academic_years
+  end
+
+  def organizations
+    about&.alumni_organizations
+  end
+
   def url
     "https://#{domain}"
   end
-- 
GitLab