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