]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/oauth2_verifier.rb
Add missing parenthesis
[rails.git] / app / models / oauth2_verifier.rb
index 94856d0d810769610c7cf06ab548da53eb2f2805..a404d0c7a872c6d1cb8673cafdc3ea3feb792f4f 100644 (file)
@@ -1,10 +1,11 @@
 class Oauth2Verifier < OauthToken
-  validates_presence_of :user
+  validates :user, :presence => true, :associated => true
+
   attr_accessor :state
 
-  def exchange!(params={})
+  def exchange!(_params = {})
     OauthToken.transaction do
-      token = Oauth2Token.create! :user=>user,:client_application=>client_application, :scope => scope
+      token = Oauth2Token.create! :user => user, :client_application => client_application, :scope => scope
       invalidate!
       token
     end
@@ -27,7 +28,7 @@ class Oauth2Verifier < OauthToken
   protected
 
   def generate_keys
-    self.token = OAuth::Helper.generate_key(20)[0,20]
+    self.token = OAuth::Helper.generate_key(20)[0, 20]
     self.expires_at = 10.minutes.from_now
     self.authorized_at = Time.now
   end