eventus 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eventus/persistence/sequel.rb +3 -2
- data/lib/eventus/version.rb +1 -1
- data/spec/persistence/sequel_spec.rb +11 -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: 0510de94abd807d6021a437c50991ee12c0905c2
|
4
|
+
data.tar.gz: 6f0a0ae284f6c1950c64293c746e08395aca4db9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b4ab55c58fdfaf02e5f0a5d143ede5c0439ad76734d36c4ce8fd8e03d671f1348015d442bcdc605ffa67f0930d625e2aaada01bf146177d725a1bcc43a70aaf
|
7
|
+
data.tar.gz: 14e9d30c0dab348d35bdcd3693debb83c0d1f7e40317d6aaa4f50f9bbc38ff31b239abc6ccff80d0be3acd5dd886d496d531b97c98f3b56a36e630d0740b924c
|
@@ -24,10 +24,11 @@ module Eventus
|
|
24
24
|
raise Eventus::ConcurrencyError
|
25
25
|
end
|
26
26
|
|
27
|
-
def load(sid, min=nil)
|
27
|
+
def load(sid, min = nil, max = nil)
|
28
28
|
events = @dataset.where(:sid => sid)
|
29
29
|
events = events.where{ sequence >= min } if min
|
30
|
-
events.
|
30
|
+
events = events.where{ sequence <= max } if max
|
31
|
+
events.order_by(:sequence).all
|
31
32
|
end
|
32
33
|
|
33
34
|
def load_undispatched(sid = nil)
|
data/lib/eventus/version.rb
CHANGED
@@ -95,5 +95,16 @@ describe Eventus::Persistence::Sequel do
|
|
95
95
|
result = persistence.load id, 10
|
96
96
|
result.length.should == 11
|
97
97
|
end
|
98
|
+
|
99
|
+
it "should load all events up to a maximum" do
|
100
|
+
result = persistence.load id, nil, 15
|
101
|
+
result.length.should == 15
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should load events between minimum and maximum" do
|
105
|
+
result = persistence.load id, 10, 15
|
106
|
+
p result
|
107
|
+
result.length.should == 6
|
108
|
+
end
|
98
109
|
end
|
99
110
|
end
|