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

Merge branch 'master' of github.com:noesya/osuny

parents 075c115d d6ddfff1
No related branches found
No related tags found
No related merge requests found
......@@ -67,12 +67,18 @@ class Education::Program < ApplicationRecord
has_many :teachers,
class_name: 'Education::Program::Teacher',
dependent: :destroy
has_many :people,
has_many :university_people_through_teachers,
through: :teachers,
dependent: :destroy
source: :person
has_many :roles,
class_name: 'Education::Program::Role',
dependent: :destroy
has_many :role_people,
through: :roles,
source: :person
has_many :university_people_through_roles,
through: :role_people,
source: :person
has_many :website_categories,
class_name: 'Communication::Website::Category',
dependent: :destroy
......@@ -115,8 +121,11 @@ class Education::Program < ApplicationRecord
end
def git_dependencies_static
# TODO: Add Teacher & Role::Person
active_storage_blobs
[
active_storage_blobs,
university_people_through_teachers,
university_people_through_roles
].flatten.uniq.compact
end
def git_destroy_dependencies_static
......
......@@ -43,7 +43,10 @@ class University::Person < ApplicationRecord
has_many :education_program_teachers,
class_name: 'Education::Program::Teacher',
foreign_key: :person_id,
dependent: :destroy
has_many :education_program_role_people,
class_name: 'Education::Program::Role::Person',
dependent: :destroy
has_many :education_programs,
......
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