How to delete all associated records of Specific record using loop? (not Using dependent)
user4893 Published in September 19, 2018, 9:46 am
How to delete all associated records of Specific record using a loop?
like When I will delete one Specific Seller at that time their related record should be deleted.
eg. when One Seller is deleted that time their Products, Customer, SellerMarketplace should be deleted.(Not Marketplace should be deleted.)
class Seller < ActiveRecord::Base
has_many :marketplaces through: :seller_marketplaces