eventus 0.6.6 → 0.6.7
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 +4 -4
- data/lib/eventus/persistence/sequel.rb +1 -1
- data/lib/eventus/version.rb +1 -1
- data/spec/persistence/sequel_spec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4da30411f666bb3e50ec581a31e9f3e721703a4f
|
4
|
+
data.tar.gz: c800e974e35d6d6070706c58d17213cb5fe903e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a89dca93d85fb176ce473f27a95d06613226991033a5fefc70d5ec0221c371ef222ccf8a6db690e231d1ea28b722e4bc852d816547334b723fdd119f12743827
|
7
|
+
data.tar.gz: 8319eab2c36f3b2e61844214f259ac2586b21bb972e332942c6a026fcf1f707e1dd32541e1aed303c9ba4c4287d56cc1de21e1cd90b4733cec5b95eb770709f7
|
@@ -15,7 +15,7 @@ module Eventus
|
|
15
15
|
def commit(events)
|
16
16
|
@db.transaction(:savepoint => true) do
|
17
17
|
events.each do |event|
|
18
|
-
event['body'] = db.typecast_value(:json, event['body'])
|
18
|
+
event['body'] = db.typecast_value(:json, event['body'] || {})
|
19
19
|
end
|
20
20
|
@dataset.multi_insert(events)
|
21
21
|
end
|
data/lib/eventus/version.rb
CHANGED
@@ -22,6 +22,15 @@ describe Eventus::Persistence::Sequel do
|
|
22
22
|
result['body'].should == event['body']
|
23
23
|
end
|
24
24
|
|
25
|
+
it "stores nil body as empty object" do
|
26
|
+
id = uuid.generate :compact
|
27
|
+
commit = create_commit(id, 1, nil)
|
28
|
+
persistence.commit(commit)
|
29
|
+
|
30
|
+
result = persistence.load(id)[0]
|
31
|
+
result['body'].should == {}
|
32
|
+
end
|
33
|
+
|
25
34
|
it "should return events" do
|
26
35
|
id = uuid.generate :compact
|
27
36
|
o = {'a' => 'super', 'complex' => ['object', 'with', {'nested' => ['members', 'galore', 1]}]}
|