There was an error while loading. Please reload this page.
class Adv < ApplicationRecord belongs_to :cat end class Cat < ApplicationRecord has_closure_tree has_many :advs def indirect_advs Adv.where(:cat_id => descendant_ids) end end