]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/access_token.rb
Wait until after rails has initialise I18n to preload the resources
[rails.git] / app / models / access_token.rb
index b773310ceb59374bb95647f5989492869fcea6ef..a1888343a0ea387fc308638954de9d0be3e18c35 100644 (file)
@@ -1,5 +1,11 @@
-class AccessToken<OauthToken
-  validates_presence_of :user
+class AccessToken < OauthToken
+  belongs_to :user
+  belongs_to :client_application
+
+  scope :valid, where(:invalidated_at => nil)
+
+  validates_presence_of :user, :secret
+
   before_create :set_authorized_at
   
 protected 
   before_create :set_authorized_at
   
 protected 
@@ -7,4 +13,4 @@ protected
   def set_authorized_at
     self.authorized_at = Time.now
   end
   def set_authorized_at
     self.authorized_at = Time.now
   end
-end
\ No newline at end of file
+end