X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b8f6dbd403507edd14f04f3151c285e232607360..a6b84a0294a2929006ff056f56103be549c5b5a2:/app/models/access_token.rb diff --git a/app/models/access_token.rb b/app/models/access_token.rb index b773310ce..2bf226784 100644 --- a/app/models/access_token.rb +++ b/app/models/access_token.rb @@ -1,10 +1,16 @@ -class AccessToken { where(:invalidated_at => nil) } + + validates_presence_of :user, :secret + before_create :set_authorized_at - -protected - + + protected + def set_authorized_at self.authorized_at = Time.now end -end \ No newline at end of file +end