X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/34e3e51456774127d43408b7ab65c24f41373f62..1d49b0d71df85ca7f6d049c2ccd2bed0999f2a79:/app/models/access_token.rb diff --git a/app/models/access_token.rb b/app/models/access_token.rb index 6e48c996d..f690c9754 100644 --- a/app/models/access_token.rb +++ b/app/models/access_token.rb @@ -4,11 +4,11 @@ class AccessToken < OauthToken scope :valid, -> { where(:invalidated_at => nil) } - validates_presence_of :user, :secret + validates :user, :secret, :presence => true before_create :set_authorized_at -protected + protected def set_authorized_at self.authorized_at = Time.now