X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e222329d043592af299eed12cf6ad16969c1b46f..ebaae09797d245ad05f1c00c2f8359c8868fe14d:/app/models/access_token.rb?ds=inline 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