Be careful with the shovel (<<) operator. It modifies the object on the
authorWard Vandewege <ward@clinicalfuture.com>
Mon, 4 Feb 2013 03:29:23 +0000 (22:29 -0500)
committerWard Vandewege <ward@clinicalfuture.com>
Mon, 4 Feb 2013 03:29:23 +0000 (22:29 -0500)
left hand side. And if that object is just a copy (i.e. reference to) of
another object, bad things like on-the-fly modification of the
orvos_login_base configuration value occur...

This fixes the multiplication of return_to parameters on every call to
the login url.

app/models/orvos_api_client.rb

index 417b1c2be287e9bab3a0732346462a2ef461ad68..e48144f3b53dee436114b766957ac73c7dc48bf5 100644 (file)
@@ -74,7 +74,7 @@ class OrvosApiClient
       uri = self.orvos_v1_base.sub(%r{/orvos/v\d+.*}, '/login')
     end
     if params.size > 0
-      uri << '?' << params.collect { |k,v|
+      uri += '?' << params.collect { |k,v|
         CGI.escape(k.to_s) + '=' + CGI.escape(v.to_s)
       }.join('&')
     end