rails_event_store_active_record-legacy 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf6ac94426ae4212908a7df409aa0be8a17747a408fb80cf8d067c2cc8dc9a9c
4
- data.tar.gz: 6e9f96e17d8e31c6e9867487889c17da9e97458994564b0a66bc07acf95dd282
3
+ metadata.gz: 6ed86e078cbea863e39cc1e4e009a6f34aff0eb566231c5ab27d0cc1fde1172d
4
+ data.tar.gz: 4525df4964a5da84b61ea74e4865c800647994593e7ffb8e91e1d5168212595d
5
5
  SHA512:
6
- metadata.gz: 3fbfe5828a4370f8672d63639cf44c9c698a46677a0645691e8109a27f477e10858624177ec28e05abe157b47c6c5dc74f9d84ea4e2f007d881c23b2ee4b32dd
7
- data.tar.gz: 51118475dc45c0b1b7973fd203b57268a677ef4b39b34f9e2c36247160be0d92d2a4aec5df5df1aecf0259f7835861e2a4c4a371cc5406364ea37216ce17825d
6
+ metadata.gz: 35a61887f1ec70dd3af1b5c1e950936bd276b3d1adadda0b2cd73c2b12d80399d53b5c69e9f33d8d9594cefca280f66ca1e53a2f337680bac5be61435ed120e1
7
+ data.tar.gz: e8c933f7750da1762fe94a03efbf90da78e69c2278b3054261c9d51fb82642cb66207622f138ca4c821aae1bce1ff7d6f097bef934cae141dc91ac58361a4cab
@@ -65,11 +65,20 @@ instead:
65
65
  stream = stream.where(start_condition(spec)) unless spec.head?
66
66
  stream = stream.where(stream: spec.stream_name) unless spec.global_stream?
67
67
 
68
- stream.map(&method(:build_event_entity)).each
68
+ if spec.batched?
69
+ batch_reader = ->(offset, limit) { stream.offset(offset).limit(limit).map(&method(:build_event_entity)) }
70
+ RubyEventStore::BatchEnumerator.new(spec.batch_size, total_limit(spec), batch_reader).each
71
+ else
72
+ stream.map(&method(:build_event_entity)).each
73
+ end
69
74
  end
70
75
 
71
76
  private
72
77
 
78
+ def total_limit(specification)
79
+ specification.limit? ? specification.count : Float::INFINITY
80
+ end
81
+
73
82
  def start_condition(specification)
74
83
  event_record =
75
84
  LegacyEvent.find_by!(event_id: specification.start)
@@ -1,5 +1,5 @@
1
1
  module RailsEventStoreActiveRecord
2
2
  module Legacy
3
- VERSION = "0.29.0"
3
+ VERSION = "0.30.0"
4
4
  end
5
5
  end
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency 'childprocess'
39
39
  spec.add_development_dependency 'mutant-rspec', '~> 0.8.14'
40
40
 
41
- spec.add_dependency 'ruby_event_store', '= 0.29.0'
41
+ spec.add_dependency 'ruby_event_store', '= 0.30.0'
42
42
  spec.add_dependency 'activesupport', '>= 3.0'
43
43
  spec.add_dependency 'activemodel', '>= 3.0'
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_store_active_record-legacy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-06 00:00:00.000000000 Z
11
+ date: 2018-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.29.0
145
+ version: 0.30.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.29.0
152
+ version: 0.30.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: activesupport
155
155
  requirement: !ruby/object:Gem::Requirement