Skip to content
Snippets Groups Projects
Unverified Commit b33f80c1 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

clean & iso

parent 553dd758
No related branches found
No related tags found
No related merge requests found
...@@ -114,13 +114,12 @@ class Education::Program < ApplicationRecord ...@@ -114,13 +114,12 @@ class Education::Program < ApplicationRecord
-> { distinct }, -> { distinct },
through: :schools through: :schools
has_many :cohorts,
class_name: 'Education::Cohort'
has_many :education_cohorts, has_many :education_cohorts,
class_name: 'Education::Cohort' class_name: 'Education::Cohort'
alias_attribute :cohorts, :education_cohorts
has_many :alumni, has_many :alumni,
through: :cohorts, through: :education_cohorts,
source: :people source: :people
alias_attribute :university_person_alumni, :alumni alias_attribute :university_person_alumni, :alumni
...@@ -129,7 +128,6 @@ class Education::Program < ApplicationRecord ...@@ -129,7 +128,6 @@ class Education::Program < ApplicationRecord
class_name: 'University::Person::Experience', class_name: 'University::Person::Experience',
through: :alumni, through: :alumni,
source: :experiences source: :experiences
alias_attribute :experiences, :alumni_experiences
alias_attribute :university_person_experiences, :alumni_experiences alias_attribute :university_person_experiences, :alumni_experiences
has_many :alumni_organizations, has_many :alumni_organizations,
...@@ -142,7 +140,7 @@ class Education::Program < ApplicationRecord ...@@ -142,7 +140,7 @@ class Education::Program < ApplicationRecord
has_many :education_academic_years, has_many :education_academic_years,
-> { distinct }, -> { distinct },
class_name: 'Education::AcademicYear', class_name: 'Education::AcademicYear',
through: :cohorts, through: :education_cohorts,
source: :academic_year source: :academic_year
alias_attribute :academic_years, :education_academic_years alias_attribute :academic_years, :education_academic_years
......
...@@ -76,7 +76,6 @@ class Education::School < ApplicationRecord ...@@ -76,7 +76,6 @@ class Education::School < ApplicationRecord
class_name: 'University::Person::Experience', class_name: 'University::Person::Experience',
through: :alumni, through: :alumni,
source: :experiences source: :experiences
alias_attribute :experiences, :alumni_experiences
alias_attribute :university_person_experiences, :alumni_experiences alias_attribute :university_person_experiences, :alumni_experiences
has_many :alumni_organizations, -> { distinct }, has_many :alumni_organizations, -> { distinct },
...@@ -92,8 +91,7 @@ class Education::School < ApplicationRecord ...@@ -92,8 +91,7 @@ class Education::School < ApplicationRecord
has_many :education_cohorts, -> { distinct }, has_many :education_cohorts, -> { distinct },
class_name: 'Education::Cohort', class_name: 'Education::Cohort',
through: :programs, through: :programs
source: :cohorts
alias_attribute :cohorts, :education_cohorts alias_attribute :cohorts, :education_cohorts
validates :name, :address, :city, :zipcode, :country, presence: true validates :name, :address, :city, :zipcode, :country, presence: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment