active_remote 2.0.1 → 2.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75e05a76039dc8d851f60fce3e0ccf7f0a0b9640
4
- data.tar.gz: 39a54ee4bfc9f1fc2b5ed191c3a40b6dfa2e910b
3
+ metadata.gz: 8da0d6b9a19c100a7c36a11ef650e1d788f4b493
4
+ data.tar.gz: 1da175673f70cbd2eed8686fb27447d19c51b222
5
5
  SHA512:
6
- metadata.gz: 861f57dbc0304deb5534596447c517169529c8738d128d2c29f6d170b43f23abbb101975979f019eb6df836706a9d0d6c5e9c2bca840eb60c5dd15f73603393b
7
- data.tar.gz: d57cde44a3b9a2cff12db7c0ce34aa4aa78a75f17b6eaeb1ed54de3ee99d8e75a0219e3f885cbc2a191b247855fc5171cd6a063c0f6849a4334eff50471574d2
6
+ metadata.gz: 864b2fa737f45a1a8988b40aaace637c8ded669f4012f0a49d892fb325cbf42cb1acfbef159d3b09443de7328082b342f950ea37abc7f375d2a83ede46a5b77f
7
+ data.tar.gz: 7120238fbe22ca117d738b76f95625eb78c91e1cb52070d6d2c7a41933ce4c952deaaa61c0968352ae3f645807f559e8ff1a97f1087a660b5da1db2c8bff2e7c
@@ -107,7 +107,7 @@ module ActiveRemote
107
107
  records.collect!(&:to_hash)
108
108
  end
109
109
 
110
- return records.first if records.first.has_key?(:records)
110
+ return records.first if records.first && records.first.has_key?(:records)
111
111
 
112
112
  # If we made it this far, build a bulk-formatted hash.
113
113
  return { :records => records }
@@ -1,3 +1,3 @@
1
1
  module ActiveRemote
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -42,12 +42,17 @@ describe ActiveRemote::Bulk do
42
42
 
43
43
  describe ".parse_records" do
44
44
  let(:records) { [ Hash.new ] }
45
+ let(:empty_records) { [] }
45
46
  let(:attribute_record) {
46
47
  record = double(Hash)
47
48
  record.stub(:attributes) { {} }
48
49
  record
49
50
  }
50
- let(:records) { [ Hash.new ] }
51
+
52
+ it "returns an empty array when given empty records" do
53
+ parsed_records = { :records => [] }
54
+ Tag.parse_records(empty_records).should eq(parsed_records)
55
+ end
51
56
 
52
57
  it "preps records to be built into a bulk request" do
53
58
  parsed_records = { :records => records }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-27 00:00:00.000000000 Z
11
+ date: 2014-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_attr