Class: Omnisocial::LoginAccount
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Omnisocial::LoginAccount
show all
- Defined in:
- app/models/omnisocial/login_account.rb
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 |account|
account.assign_account_info(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 (account = find_by_remote_account_id(auth_hash['uid']))
account.assign_account_info(auth_hash)
account.save
account
else
create_from_auth_hash(auth_hash)
end
end
|