]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/access_token.rb
Bump qs from 6.11.2 to 6.12.0
[rails.git] / app / models / access_token.rb
index 1a5ff8553c825a785ee5fff21fa1aa42dcae618c..d2c0dba1ce85a93e39b7838f0e6b1bcbd24f88e5 100644 (file)
@@ -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