]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/access_token.rb
Merge branch 'rails41'
[rails.git] / app / models / access_token.rb
index 1f172c5f009b547e51f71388f02356f21603197c..3aa6f9daf7fddfd587f5ae6f81b77942b9755d00 100644 (file)
@@ -2,9 +2,9 @@ class AccessToken < OauthToken
   belongs_to :user
   belongs_to :client_application
 
-  scope :valid, where(:invalidated_at => nil)
+  scope :valid, -> { where(:invalidated_at => nil) }
 
-  validates_presence_of :user
+  validates_presence_of :user, :secret
 
   before_create :set_authorized_at