canonical-rails 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eec59e3324fff400a64b6171ab133c8e28c5afe
4
- data.tar.gz: b94aa1049224b4ce24b8befd90d003403a811ef3
3
+ metadata.gz: ccc17e60d57cf2678fae82ce8714e93c3507399e
4
+ data.tar.gz: a25733846d8db5cd144075730d16e2944516bc56
5
5
  SHA512:
6
- metadata.gz: 7e7798e0bf8918c44b5dd8a8b34655f73808ae8a22f211b551fe78a2f5565a6f139e16bcd4a315835e49aa667ade1dc5bfc2076bb0821357365978ad251686a0
7
- data.tar.gz: 70f4ced48fc46b56e18d4d9226b68e129962a77df8eb138900ad85acd631ccf9eb88863848e6733b507aacddcff85535dcd98f9724cdeb41555b62d94fdfe8a4
6
+ metadata.gz: fa4c02c6d87c9923b1a0adb553bcd507c53c42abb7d2bb2156a5929dd2d29e8cc652f62fede618394dd3e49f32886643931cedc412b0ad9722a2a870dcb649bc
7
+ data.tar.gz: c44509c74e0b4932dc1990bf24a2ef4ea794ddcfeb042beea559b76b0d84dce277faa35a6af545d990f3fe371225b3b74f6dcd1370cbdd494e9794469447f022
@@ -37,7 +37,17 @@ module CanonicalRails
37
37
  end
38
38
 
39
39
  def whitelisted_query_string
40
- "?" + Rack::Utils.build_nested_query(whitelisted_params) if whitelisted_params.present?
40
+ # Rack 1.4.5 fails to handle params that are not strings
41
+ # So if
42
+ # my_hash = { "a" => 1, "b" => 2}
43
+ # Rack::Utils.build_nested_query(my_hash) would return
44
+ # "a&b"
45
+ # Rack 1.4.5 did not have a test case for this scenario
46
+ # https://github.com/rack/rack/blob/9939d40a5e23dcb058751d1029b794aa2f551900/test/spec_utils.rb#L222
47
+ # Rack 1.6.0 has it
48
+ # https://github.com/rack/rack/blob/65a7104b6b3e9ecd8f33c63a478ab9a33a103507/test/spec_utils.rb#L251
49
+
50
+ "?" + Rack::Utils.build_nested_query(Hash[whitelisted_params.map{|k,v| v.is_a?(Numeric) ? [k,v.to_s] : [k,v]}]) if whitelisted_params.present?
41
51
  end
42
52
  end
43
53
  end
@@ -1,3 +1,3 @@
1
1
  module CanonicalRails
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canonical-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Ivanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-11 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails