X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e222329d043592af299eed12cf6ad16969c1b46f..e68d4efc3cdf02f35144e3967be998aaa633a3de:/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