Skip to content

Instantly share code, notes, and snippets.

@SoldierCoder
Created October 2, 2011 06:58
Show Gist options
  • Save SoldierCoder/1257167 to your computer and use it in GitHub Desktop.
Save SoldierCoder/1257167 to your computer and use it in GitHub Desktop.
is User saved after first end below?
class User < ActiveRecord::Base
has_many :campaign_supporters
has_many :campaigns, :through => :campaign_supporters
def self.create_with_omniauth(auth)
create! do |user|
user.provider = auth["provider"]
user.uid = auth["uid"]
user.name = auth["user_info"]["name"]
user.access_token = auth["user_info"]["access_token"]
user.access_secret = auth["user_info"]["access__secret"]
user.followers_count= auth["followers_count"]
user.created_at = auth["user_info"]["created_at"]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment