From ad2b1088a962bcef255e89e6633b87e247305057 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Wed, 27 Oct 2021 16:31:50 +0200 Subject: [PATCH] import categories --- app/models/communication/website/category.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/models/communication/website/category.rb b/app/models/communication/website/category.rb index 108c7e5fc..675f1c697 100644 --- a/app/models/communication/website/category.rb +++ b/app/models/communication/website/category.rb @@ -34,10 +34,13 @@ class Communication::Website::Category < ApplicationRecord belongs_to :parent, class_name: 'Communication::Website::Category', optional: true - has_many :children, - class_name: 'Communication::Website::Category', - foreign_key: :parent_id, - dependent: :destroy + has_one :imported_category, + class_name: 'Communication::Website::Imported::Category', + dependent: :destroy + has_many :children, + class_name: 'Communication::Website::Category', + foreign_key: :parent_id, + dependent: :destroy has_and_belongs_to_many :posts, class_name: 'Communication::Website::Post', join_table: 'communication_website_categories_posts', -- GitLab