Created
May 6, 2015 23:53
-
-
Save ckuwanoe/4cbf48974b05a459ab12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.from_omniauth(auth, ref) | |
where(provider: auth.provider, uid: auth.uid).first_or_create do |user| | |
user.email = "#{auth.info.nickname}@twitter.com" | |
user.password = Devise.friendly_token[0,20] | |
user.username = auth.info.nickname # assuming the user model has a name | |
user.referrer_token = ref.to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment