summaryrefslogtreecommitdiff
path: root/users/app
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-11-07 23:36:37 +0100
committerAzul <azul@leap.se>2013-11-08 09:45:28 +0100
commita7cd2ef0877e79302f27fb175384a0cf4ded52d9 (patch)
tree95937da00aeeca34dac67ccd801bad2ad496455e /users/app
parente2c0962077cf759b23639276cca42606ea2135ec (diff)
fix cornercase of non expiring tokens
Diffstat (limited to 'users/app')
-rw-r--r--users/app/models/token.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/users/app/models/token.rb b/users/app/models/token.rb
index bf9b0d0..001eb40 100644
--- a/users/app/models/token.rb
+++ b/users/app/models/token.rb
@@ -20,7 +20,8 @@ class Token < CouchRest::Model::Base
end
def self.expired
- self.by_last_seen_at.endkey(expires_after.minutes.ago)
+ return [] unless expires_after
+ by_last_seen_at.endkey(expires_after.minutes.ago)
end
def self.destroy_all_expired