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

fix missing program page categories association def

parent c4b3beae
No related tags found
No related merge requests found
...@@ -12,6 +12,10 @@ module Education::Program::WithWebsitesCategories ...@@ -12,6 +12,10 @@ module Education::Program::WithWebsitesCategories
class_name: 'Communication::Website::Portfolio::Category', class_name: 'Communication::Website::Portfolio::Category',
dependent: :destroy dependent: :destroy
has_many :website_page_categories,
class_name: 'Communication::Website::Page::Category',
dependent: :destroy
has_many :website_post_categories, has_many :website_post_categories,
class_name: 'Communication::Website::Post::Category', class_name: 'Communication::Website::Post::Category',
dependent: :destroy dependent: :destroy
...@@ -26,6 +30,7 @@ module Education::Program::WithWebsitesCategories ...@@ -26,6 +30,7 @@ module Education::Program::WithWebsitesCategories
categories[:events] = website_agenda_categories.find_by(communication_website_id: website.id)&.localization_for(language) categories[:events] = website_agenda_categories.find_by(communication_website_id: website.id)&.localization_for(language)
categories[:posts] = website_post_categories.find_by(communication_website_id: website.id)&.localization_for(language) categories[:posts] = website_post_categories.find_by(communication_website_id: website.id)&.localization_for(language)
categories[:projects] = website_portfolio_categories.find_by(communication_website_id: website.id)&.localization_for(language) categories[:projects] = website_portfolio_categories.find_by(communication_website_id: website.id)&.localization_for(language)
categories[:pages] = website_page_categories.find_by(communication_website_id: website.id)&.localization_for(language)
categories.compact categories.compact
end end
end end
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