how to use dependant destroy rails code example Example: active record dependent destroy has_many :books, dependent: :destroy