class Site < ApplicationRecord
  has_many :bookmarks
end

class Site < ApplicationRecord
  has_many :bookmarks, dependent: :destroy

  after_touch :destroy, if: -> { bookmarks.empty? }
end

Destroy Site when has no bookmarks
Destroy Site when has no bookmarks
