The situation is such, there is a category model and two product and article models. The category model can have many products and many articles. How to combine them so that you can display all products and all articles on the categories / show page, as well as individually?
class Category < ApplicationRecord has_many :products has_many :articles has_ancestry :orphan_strategy => :rootify class Product < ApplicationRecord belongs_to :category class Article < ApplicationRecord belongs_to :category