Skip to content
Snippets Groups Projects
Commit fee7e10b authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix order

parent 891e7b77
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,8 @@ class Education::Program < ApplicationRecord
include WithInheritance
include WithPosition
include WithBlocks
include WithSchools
include WithDiploma
include WithAlumni
include WithWebsites
include WithTeam
......@@ -88,16 +90,6 @@ class Education::Program < ApplicationRecord
foreign_key: :parent_id,
dependent: :destroy
belongs_to :diploma,
class_name: 'Education::Diploma',
optional: true
has_and_belongs_to_many :schools,
class_name: 'Education::School',
join_table: 'education_programs_schools',
foreign_key: 'education_program_id',
association_foreign_key: 'education_school_id'
# Deprecated, now in diploma
enum level: {
not_applicable: 0,
......
module Education::Program::WithDiploma
extend ActiveSupport::Concern
included do
belongs_to :diploma,
class_name: 'Education::Diploma',
optional: true
end
end
module Education::Program::WithSchools
extend ActiveSupport::Concern
included do
has_and_belongs_to_many :schools,
class_name: 'Education::School',
join_table: 'education_programs_schools',
foreign_key: 'education_program_id',
association_foreign_key: 'education_school_id'
end
end
......@@ -26,8 +26,8 @@
class Education::School < ApplicationRecord
include WithGit
include Aboutable
include WithPrograms # must come before WithAlumni and WithTeam
include WithTeam
include WithPrograms # must come before WithAlumni
include WithAlumni
belongs_to :university
......
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