diff options
author | elijah <elijah@riseup.net> | 2014-04-04 10:42:15 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-04-04 10:42:15 -0700 |
commit | cb6442c344d6bdaf52c3878b2de2fcf4d85f2648 (patch) | |
tree | 2d429b5d4165f3c386be4068ffaad9ede27f292b /users/app/models | |
parent | aeb5d8cf8dc6329906f14bf4595a229e002691c1 (diff) | |
parent | 85aabe832eb3eec10a29054ef5575618686eef33 (diff) |
Merge branch 'bugfix/5382-rescue-token-destruction' into develop
Diffstat (limited to 'users/app/models')
-rw-r--r-- | users/app/models/token.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/users/app/models/token.rb b/users/app/models/token.rb index 001eb40..4856c31 100644 --- a/users/app/models/token.rb +++ b/users/app/models/token.rb @@ -40,6 +40,14 @@ class Token < CouchRest::Model::Base end end + # Tokens can be cleaned up in different ways. + # So let's make sure we don't crash if they disappeared + def destroy_with_rescue + destroy_without_rescue + rescue RestClient::ResourceNotFound + end + alias_method_chain :destroy, :rescue + def touch self.last_seen_at = Time.now save |