lib/ridley/connection.rb in ridley-0.8.2 vs lib/ridley/connection.rb in ridley-0.8.3

- old
+ new

@@ -58,15 +58,20 @@ b.adapter :net_http_persistent end uri_hash = Addressable::URI.parse(server_url).to_hash.slice(:scheme, :host, :port) + unless uri_hash[:port] uri_hash[:port] = (uri_hash[:scheme] == "https" ? 443 : 80) end if org_match = server_url.match(/.*\/organizations\/(.*)/) @organization = org_match[1] + end + + unless @organization.nil? + uri_hash[:path] = "/organizations/#{@organization}" end super(Addressable::URI.new(uri_hash), options) @headers[:user_agent] = "Ridley v#{Ridley::VERSION}" end