diff options
author | Azul <azul@leap.se> | 2013-11-07 23:36:37 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-11-08 09:45:28 +0100 |
commit | a7cd2ef0877e79302f27fb175384a0cf4ded52d9 (patch) | |
tree | 95937da00aeeca34dac67ccd801bad2ad496455e /users/app | |
parent | e2c0962077cf759b23639276cca42606ea2135ec (diff) |
fix cornercase of non expiring tokens
Diffstat (limited to 'users/app')
-rw-r--r-- | users/app/models/token.rb | 3 |
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 |