1
0
Fork 0
find-us-lunch/app/models/user.rb

12 lines
331 B
Ruby
Raw Normal View History

2014-10-02 16:29:18 -04:00
class User < ActiveRecord::Base
def self.from_omniauth(auth)
where(provider: auth[:provider], uid: auth[:uid]).first_or_create do |user|
user.provider = auth[:provider]
user.uid = auth[:uid]
user.name = auth[:info][:name]
user.email = auth[:info][:email]
user.save
end
end
end