Class: UserAccount

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

Class Method Summary collapse

Class Method Details

.create_with_omniauth!(auth, user_id) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'app/models/user_account.rb', line 3

def self.create_with_omniauth!(auth,user_id)
  create! do ||
    .user_id = user_id
    .provider = auth['provider']
    .uid = auth['uid']
    info = auth["info"] || {}
    .nickname = info['nickname']
    .name = info['name']
  end
end