Skip to content

Commit

Permalink
Remove explicit query param sorting
Browse files Browse the repository at this point in the history
This fixed #192 and removes the sorting for query values.

Since this feature was used to support the now unsupported
  1.8.x, it can be removed.

Conflicts:
	spec/addressable/uri_spec.rb
  • Loading branch information
Jake Yesbeck committed Apr 18, 2016
1 parent ca387e9 commit 2e03569
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions lib/addressable/uri.rb
Expand Up @@ -1607,9 +1607,6 @@ def query_values=(new_query_values)
key = key.to_s if key.kind_of?(Symbol)
[key, value]
end
# Useful default for OAuth and caching.
# Only to be used for non-Array inputs. Arrays should preserve order.
new_query_values.sort!
end

# new_query_values have form [['key1', 'value1'], ['key2', 'value2']]
Expand Down
5 changes: 3 additions & 2 deletions spec/addressable/uri_spec.rb
Expand Up @@ -5696,9 +5696,10 @@ def to_str
@uri.query.should == nil
end

it "should correctly sort {'ab' => 'c', :ab => 'a', :a => 'x'}" do
it "should maintain original ordering: {'ab' => 'c', :ab => 'a', :a => 'x'}" do
@uri.query_values = {'ab' => 'c', :ab => 'a', :a => 'x'}
@uri.query.should == "a=x&ab=a&ab=c"

@uri.query.should == "ab=c&ab=a&a=x"
end

it "should correctly assign " +
Expand Down

0 comments on commit 2e03569

Please sign in to comment.