Skip to content

Instantly share code, notes, and snippets.

@leucos
Created March 21, 2012 13:42
Show Gist options
  • Save leucos/2146971 to your computer and use it in GitHub Desktop.
Save leucos/2146971 to your computer and use it in GitHub Desktop.
Sequel hook to remove associated entries
class Domain < Sequel::Model
one_to_many :records
def before_destroy
Record.filter(:domain_id => id).destroy
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment