Module: Devise::Models::Lastseenable

Defined in:
lib/rego-devise-lastseenable/model.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#stamp!Object



6
7
8
9
10
11
12
# File 'lib/rego-devise-lastseenable/model.rb', line 6

def stamp!
  interval = self.class.lastseenable_interval
  if self.last_seen_at.to_i < (Time.now - interval.minutes).to_i
    self.last_seen_at = DateTime.now
    self.save!
  end
end