X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/908a6ef409518d86bfd2cdf0d2a82a6c312821c8..857f0f460b3cee78454519f9764a4091204bc1a6:/app/models/access_token.rb diff --git a/app/models/access_token.rb b/app/models/access_token.rb index b773310ce..f690c9754 100644 --- a/app/models/access_token.rb +++ b/app/models/access_token.rb @@ -1,10 +1,16 @@ -class AccessToken { where(:invalidated_at => nil) } + + validates :user, :secret, :presence => true + 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