Class: Omnisocial::LoginAccount

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

Direct Known Subclasses

FacebookAccount, TwitterAccount

Class Method Summary collapse

Class Method Details

.create_from_auth_hash(auth_hash) ⇒ Object



15
16
17
18
19
# File 'app/models/omnisocial/login_account.rb', line 15

def self.create_from_auth_hash(auth_hash)
  create do ||
    .(auth_hash)
  end
end

.find_or_create_from_auth_hash(auth_hash) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/models/omnisocial/login_account.rb', line 5

def self.find_or_create_from_auth_hash(auth_hash)
  if ( = (auth_hash['uid']))
    .(auth_hash)
    .save
    
  else
    create_from_auth_hash(auth_hash)
  end
end