Skip to content

Instantly share code, notes, and snippets.

@Zhomart
Created July 18, 2012 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zhomart/3135782 to your computer and use it in GitHub Desktop.
Save Zhomart/3135782 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
# here use after create callback
# http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
after_create :create_facebookdata
def create_facebookdata
# do some stuff here
self.facebookdata = Facebookdata.new
self.facebookdata.save!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment