X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9018d1af07c53b03bf8caf0480b931dc25f57147..ef53abcdd43152f0cf7d80c304eb878b2b68387c:/app/models/access_token.rb diff --git a/app/models/access_token.rb b/app/models/access_token.rb index 1a5ff8553..d2c0dba1c 100644 --- a/app/models/access_token.rb +++ b/app/models/access_token.rb @@ -36,8 +36,8 @@ # class AccessToken < OauthToken - belongs_to :user - belongs_to :client_application + belongs_to :user, :optional => true + belongs_to :client_application, :optional => true scope :valid, -> { where(:invalidated_at => nil) } @@ -52,6 +52,6 @@ class AccessToken < OauthToken protected def set_authorized_at - self.authorized_at = Time.now + self.authorized_at = Time.now.utc end end