]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_token.rb
Don't show unredacted element versions to non-moderators
[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?