Module: Devise::Models::Sociable

Defined in:
lib/devise_sociable/model.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
# File 'lib/devise_sociable/model.rb', line 7

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#active?(last_access) ⇒ Boolean

last_access is a time or duration (number)

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/devise_sociable/model.rb', line 12

def active?(last_access)
  last_access = last_access.ago if last_access.is_a? Fixnum
  self.class.cached?(self) || self.class.actives(last_access).include?(self)
end

#deactivate!Object



17
18
19
# File 'lib/devise_sociable/model.rb', line 17

def deactivate!
  self.class.remove_from_cache(self)
end