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