Class: Omnisocial::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Omnisocial::User
- Defined in:
- app/models/omnisocial/user.rb
Direct Known Subclasses
Instance Method Summary collapse
- #forget ⇒ Object
- #from_facebook? ⇒ Boolean
- #from_linked_in? ⇒ Boolean
- #from_twitter? ⇒ Boolean
- #remember ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#forget ⇒ Object
32 33 34 |
# File 'app/models/omnisocial/user.rb', line 32 def forget update_attributes(:remember_token => nil) unless new_record? end |
#from_facebook? ⇒ Boolean
20 21 22 |
# File 'app/models/omnisocial/user.rb', line 20 def from_facebook? login_account.kind_of? FacebookAccount end |
#from_linked_in? ⇒ Boolean
24 25 26 |
# File 'app/models/omnisocial/user.rb', line 24 def from_linked_in? login_account.kind_of? LinkedInAccount end |
#from_twitter? ⇒ Boolean
16 17 18 |
# File 'app/models/omnisocial/user.rb', line 16 def from_twitter? login_account.kind_of? TwitterAccount end |
#remember ⇒ Object
28 29 30 |
# File 'app/models/omnisocial/user.rb', line 28 def remember update_attributes(:remember_token => ::BCrypt::Password.create("#{Time.now}-#{self.login_account.type}-#{self.login}")) unless new_record? end |
#to_param ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/models/omnisocial/user.rb', line 8 def to_param if !self.login.include?('profile.php?') "#{self.id}-#{self.login.gsub('.', '-')}" else self.id.to_s end end |