forked from External/greenlight
10 lines
229 B
Ruby
10 lines
229 B
Ruby
class User < ApplicationRecord
|
|
|
|
def self.from_omniauth(auth_hash)
|
|
user = find_or_create_by(uid: auth_hash['uid'], provider: auth_hash['provider'])
|
|
user.name = auth_hash['info']['name']
|
|
user.save!
|
|
user
|
|
end
|
|
end
|