class Category < ApplicationRecord
has_many :snips, dependent: :restrict_with_error
end
Sometimes cascading deletes are the wrong UX and the wrong ops story. Restrict deletion when children exist and provide a user-facing error. This prevents data loss accidents.