]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/access_token.rb
Update some more queries to use AREL in place of deprecated methods
[rails.git] / app / models / access_token.rb
index b773310ceb59374bb95647f5989492869fcea6ef..1f172c5f009b547e51f71388f02356f21603197c 100644 (file)
@@ -1,5 +1,11 @@
-class AccessToken<OauthToken
+class AccessToken < OauthToken
+  belongs_to :user
+  belongs_to :client_application
+
+  scope :valid, where(:invalidated_at => nil)
+
   validates_presence_of :user
+
   before_create :set_authorized_at
   
 protected 
@@ -7,4 +13,4 @@ protected
   def set_authorized_at
     self.authorized_at = Time.now
   end
-end
\ No newline at end of file
+end