]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/access_token.rb
Remove unused files
[rails.git] / app / models / access_token.rb
index a1888343a0ea387fc308638954de9d0be3e18c35..f690c97542472dfa4fdbc54b5826e5dea4cf2d37 100644 (file)
@@ -2,14 +2,14 @@ class AccessToken < OauthToken
   belongs_to :user
   belongs_to :client_application
 
   belongs_to :user
   belongs_to :client_application
 
-  scope :valid, where(:invalidated_at => nil)
+  scope :valid, -> { where(:invalidated_at => nil) }
 
 
-  validates_presence_of :user, :secret
+  validates :user, :secret, :presence => true
 
   before_create :set_authorized_at
 
   before_create :set_authorized_at
-  
-protected 
-  
+
+  protected
+
   def set_authorized_at
     self.authorized_at = Time.now
   end
   def set_authorized_at
     self.authorized_at = Time.now
   end