You can also have AR handle the referential integrity:
class Group < ActiveRecord::Base
has_many :ranks, :dependent => :destroy
When you delete a group, AR will delete its ranks in the same
transaction so you shouldn't see the delay.
Or course you might want to also declare the constraints in SQL if non
AR code is manipulating the database.