]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/request_token.rb
Clone objects before saving in case of a retry
[rails.git] / app / models / request_token.rb
index 02f1683465111c32aeda63d54b75c9f3bd6c3f5c..c0f0194860f0117fcf71181301bfb2c53385a849 100644 (file)
@@ -17,7 +17,7 @@ class RequestToken < OauthToken
       params = { :user => user, :client_application => client_application }
       # copy the permissions from the authorised request token to the access token
       client_application.permissions.each do |p|
-        params[p] = read_attribute(p)
+        params[p] = self[p]
       end
 
       access_token = AccessToken.create(params)
@@ -35,7 +35,7 @@ class RequestToken < OauthToken
   end
 
   def oob?
-    callback_url.nil? || callback_url.downcase == "oob"
+    callback_url.nil? || callback_url.casecmp("oob").zero?
   end
 
   def oauth10?