1
0
mirror of https://github.com/danbee/my-images synced 2025-03-04 08:49:05 +00:00
my-images/app/models/user.rb
2014-03-24 17:06:09 +00:00

13 lines
348 B
Ruby

class User < ActiveRecord::Base
def self.find_or_create_from_auth(auth)
user = User.find_by(provider: auth.provider, uid: auth.uid)
if user.blank?
User.create(provider: auth.provider,
uid: auth.uid,
username: auth.info.nickname,
name: auth.info.name)
end
user
end
end