rails_event_store_active_record 0.32.0 → 0.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_event_store_active_record/correct_schema_verifier.rb +10 -2
- data/lib/rails_event_store_active_record/event_repository.rb +0 -4
- data/lib/rails_event_store_active_record/event_repository_reader.rb +1 -13
- data/lib/rails_event_store_active_record/version.rb +1 -1
- data/rails_event_store_active_record.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a49f351fe34c72ae9e6c6da5d5716071ee44855ab53b7dabb6f3bd6ae0a1d5a0
|
4
|
+
data.tar.gz: 94f26c9f91f300becfd53aead26fd3adbb804464bc0ef8d264dee5d6592b3c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aa5b1f0c9ef1ed44ff8843e2236e6c3ad1a9362b8717799729ee804683ea0be8233f9a5a1402fa0cd340ae06bc48bd809f21a241736dd34104afbe59750f5a0
|
7
|
+
data.tar.gz: '09dfc711d13207f7a66804cbada368f6a4c5cf964cbe5070d98cbe3b20fd15aa85bd18fb050f17c69b078636459f1c0221aacb868f9e81836cc7f64421c363c3'
|
@@ -6,12 +6,20 @@ module RailsEventStoreActiveRecord
|
|
6
6
|
|
7
7
|
class CorrectSchemaVerifier
|
8
8
|
def verify
|
9
|
-
return unless
|
9
|
+
return unless connected? && table_exists?
|
10
10
|
raise_invalid_db_schema if legacy_columns.eql?(current_columns)
|
11
11
|
end
|
12
12
|
|
13
13
|
private
|
14
14
|
|
15
|
+
def connected?
|
16
|
+
ActiveRecord::Base.connected?
|
17
|
+
end
|
18
|
+
|
19
|
+
def table_exists?
|
20
|
+
ActiveRecord::Base.connection.table_exists?(:event_store_events)
|
21
|
+
end
|
22
|
+
|
15
23
|
def raise_invalid_db_schema
|
16
24
|
raise EventRepository::InvalidDatabaseSchema.new(incorrect_schema_message)
|
17
25
|
end
|
@@ -66,4 +74,4 @@ old repository. In order to do so:
|
|
66
74
|
end
|
67
75
|
|
68
76
|
private_constant(:CorrectSchemaVerifier)
|
69
|
-
end
|
77
|
+
end
|
@@ -10,23 +10,11 @@ module RailsEventStoreActiveRecord
|
|
10
10
|
record && build_event_instance(record)
|
11
11
|
end
|
12
12
|
|
13
|
-
def read_event(event_id)
|
14
|
-
event = Event.find(event_id)
|
15
|
-
RubyEventStore::SerializedRecord.new(
|
16
|
-
event_id: event.id,
|
17
|
-
metadata: event.metadata,
|
18
|
-
data: event.data,
|
19
|
-
event_type: event.event_type
|
20
|
-
)
|
21
|
-
rescue ActiveRecord::RecordNotFound
|
22
|
-
raise RubyEventStore::EventNotFound.new(event_id)
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
13
|
def read(spec)
|
27
14
|
raise RubyEventStore::ReservedInternalName if spec.stream.name.eql?(EventRepository::SERIALIZED_GLOBAL_STREAM_NAME)
|
28
15
|
|
29
16
|
stream = EventInStream.preload(:event).where(stream: normalize_stream_name(spec))
|
17
|
+
stream = stream.where(event_id: spec.with_ids) if spec.with_ids?
|
30
18
|
stream = stream.order(position: order(spec)) unless spec.stream.global?
|
31
19
|
stream = stream.limit(spec.limit) if spec.limit?
|
32
20
|
stream = stream.where(start_condition(spec)) unless spec.head?
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency 'childprocess'
|
38
38
|
spec.add_development_dependency 'google-protobuf', '~> 3.5.1.2'
|
39
39
|
|
40
|
-
spec.add_dependency 'ruby_event_store', '= 0.
|
40
|
+
spec.add_dependency 'ruby_event_store', '= 0.33.0'
|
41
41
|
spec.add_dependency 'activesupport', '>= 3.0'
|
42
42
|
spec.add_dependency 'activemodel', '>= 3.0'
|
43
43
|
spec.add_dependency 'activerecord-import', '~> 0.21'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_event_store_active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.33.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-
|
11
|
+
date: 2018-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - '='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.
|
173
|
+
version: 0.33.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - '='
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
180
|
+
version: 0.33.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: activesupport
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
271
|
rubyforge_project:
|
272
|
-
rubygems_version:
|
272
|
+
rubygems_version: 3.0.0.beta1
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: Active Record events repository for Rails Event Store
|