Class: Omnisocial::User

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

Direct Known Subclasses

User

Instance Method Summary collapse

Instance Method Details

#facebook_accountObject



6
7
8
# File 'app/models/omnisocial/user.rb', line 6

def 
  .select{|| .kind_of? FacebookAccount}.first
end

#forgetObject



26
27
28
# File 'app/models/omnisocial/user.rb', line 26

def forget
  update_attributes(:remember_token => nil) unless new_record?
end

#from_facebook?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/models/omnisocial/user.rb', line 10

def from_facebook?
  !!
end

#from_twitter?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/models/omnisocial/user.rb', line 14

def from_twitter?
  !!
end

#rememberObject



22
23
24
# File 'app/models/omnisocial/user.rb', line 22

def remember
  update_attributes(:remember_token => ::BCrypt::Password.create("#{Time.now}-#{self..first.type}-#{self..first.}")) unless new_record?
end

#twitter_accountObject



18
19
20
# File 'app/models/omnisocial/user.rb', line 18

def 
  .select{|| .kind_of? TwitterAccount}.first
end