X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7e5cbe87ed37f9cba8224fa4049047d7f981f66a..a1a6c577e8f406c0d0fa31326209c98ebd78954d:/app/models/user_token.rb 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?