X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b5f06e06c14f440d3c014b348149fe9ec1b67657..b42d48ff65b10ae51696e38e4fa8f969c7a3710c:/app/models/user_token.rb?ds=sidebyside diff --git a/app/models/user_token.rb b/app/models/user_token.rb index f927563a9..fbd276a6f 100644 --- a/app/models/user_token.rb +++ b/app/models/user_token.rb @@ -21,6 +21,8 @@ class UserToken < ApplicationRecord belongs_to :user + scope :unexpired, -> { where("expiry >= now()") } + after_initialize :set_defaults def expired?