X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b70da7b8ea15ab48bb2f34155567cea6dffc8fc9..2cd7af7e0b2ad97687849576ed4e3f52c37a6d55:/app/models/oauth_token.rb diff --git a/app/models/oauth_token.rb b/app/models/oauth_token.rb index affdcdeb8..b4519efe2 100644 --- a/app/models/oauth_token.rb +++ b/app/models/oauth_token.rb @@ -36,8 +36,8 @@ # class OauthToken < ApplicationRecord - belongs_to :client_application - belongs_to :user + belongs_to :client_application, :optional => true + belongs_to :user, :optional => true scope :authorized, -> { where("authorized_at IS NOT NULL and invalidated_at IS NULL") }