active_remote 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_remote/bulk.rb +1 -1
- data/lib/active_remote/version.rb +1 -1
- data/spec/lib/active_remote/bulk_spec.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8da0d6b9a19c100a7c36a11ef650e1d788f4b493
|
4
|
+
data.tar.gz: 1da175673f70cbd2eed8686fb27447d19c51b222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 864b2fa737f45a1a8988b40aaace637c8ded669f4012f0a49d892fb325cbf42cb1acfbef159d3b09443de7328082b342f950ea37abc7f375d2a83ede46a5b77f
|
7
|
+
data.tar.gz: 7120238fbe22ca117d738b76f95625eb78c91e1cb52070d6d2c7a41933ce4c952deaaa61c0968352ae3f645807f559e8ff1a97f1087a660b5da1db2c8bff2e7c
|
data/lib/active_remote/bulk.rb
CHANGED
@@ -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 }
|
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2014-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|