Skip to content

Instantly share code, notes, and snippets.

@Breefield
Created March 4, 2013 22:56
Show Gist options
  • Save Breefield/5086425 to your computer and use it in GitHub Desktop.
Save Breefield/5086425 to your computer and use it in GitHub Desktop.
Way 1
class User < ActiveRecord::Base
after_create :notify_user_created
def notify_user_created
User.delay.async_notify_user_created(self.id)
end
def self.async_notify_user_created(id)
user = User.find(id)
user.do_the_think_you_were_going_to_do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment