]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_token.rb
Merge pull request #4535 from tomhughes/rails-tokens
[rails.git] / app / models / user_token.rb
index f927563a948694b80197a2cdf1523f9f9ec126e4..fbd276a6f32d3c70cef8b4ead629e4a377369722 100644 (file)
@@ -21,6 +21,8 @@
 class UserToken < ApplicationRecord
   belongs_to :user
 
+  scope :unexpired, -> { where("expiry >= now()") }
+
   after_initialize :set_defaults
 
   def expired?