gocardless 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.6.3 - February 11, 2013
2
+
3
+ - Handle empty arrays in Utils#flatten_params
4
+
5
+
1
6
  ## 1.6.2 - January 25, 2013
2
7
 
3
8
  - Add fee accessors to Bill
@@ -61,7 +61,7 @@ module GoCardless
61
61
  pairs = obj.map { |k,v| flatten_params(v, ns ? "#{ns}[#{k}]" : k) }
62
62
  pairs.empty? ? [] : pairs.inject(&:+)
63
63
  when Array
64
- obj.map { |v| flatten_params(v, "#{ns}[]") }.inject(&:+)
64
+ obj.map { |v| flatten_params(v, "#{ns}[]") }.inject(&:+) || []
65
65
  when Time
66
66
  [[ns.to_s, iso_format_time(obj)]]
67
67
  else
@@ -1,3 +1,3 @@
1
1
  module GoCardless
2
- VERSION = '1.6.2'.freeze
2
+ VERSION = '1.6.3'.freeze
3
3
  end
data/spec/utils_spec.rb CHANGED
@@ -133,6 +133,10 @@ describe GoCardless::Utils do
133
133
  subject['a' => ['b']].should == [['a[]', 'b']]
134
134
  end
135
135
 
136
+ it "excludes values with empty arrays" do
137
+ subject['a' => []].should == []
138
+ end
139
+
136
140
  it "includes all array values separately" do
137
141
  result = subject['a' => ['b', 'c']]
138
142
  result.should include ['a[]', 'b']
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gocardless
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.6.2
5
+ version: 1.6.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Harry Marr
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-25 00:00:00.000000000 Z
13
+ date: 2013-02-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  version_requirements: !ruby/object:Gem::Requirement