In my case model
has_many :case_products, dependent: :destroy has_many :products, through: :case_products
in my product model