Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/user.rb

Class Method Summary collapse

Class Method Details

.from_omniauth(auth) ⇒ Object


11
12
13
14
15
16
17
# File 'app/models/user.rb', line 11

def from_omniauth(auth)
	user = User.find_or_initialize_by(uid: auth['uid'])
	user.name = auth['info']['name']
	user.token = auth['credentials']['token']
	user.save!
	user
end