Skip to content

Instantly share code, notes, and snippets.

@trek
Created October 24, 2008 17:02
Show Gist options
  • Select an option

  • Save trek/19494 to your computer and use it in GitHub Desktop.

Select an option

Save trek/19494 to your computer and use it in GitHub Desktop.
Customer < ActiveRecord::Base
before_destroy :log_deletion, :email_admin
private
def log_deletion
logger.info("customer id:#{self.id} was just deleted")
end
def email_admin
...
end
end
CustomersController < ApplicationController
def destroy
Customer.destroy(parmas[:id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment