]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/oauth_token.rb
L.hash expects parseHash to return false if there isn't a location
[rails.git] / app / models / oauth_token.rb
index b38fe0ec0432707385af5f017349a834b24c8e7b..0fe0bea301eebfdc5c4da325c28ec9f214ecc463 100644 (file)
@@ -2,7 +2,7 @@ class OauthToken < ActiveRecord::Base
   belongs_to :client_application
   belongs_to :user
 
-  scope :authorized, where("authorized_at IS NOT NULL and invalidated_at IS NULL")
+  scope :authorized, -> { where("authorized_at IS NOT NULL and invalidated_at IS NULL") }
 
   validates_uniqueness_of :token
   validates_presence_of :client_application, :token
@@ -14,7 +14,7 @@ class OauthToken < ActiveRecord::Base
   end
   
   def invalidate!
-    update_attribute(:invalidated_at, Time.now)
+    update_attributes(:invalidated_at => Time.now)
   end
   
   def authorized?