ruby_event_store-active_record 2.7.0 → 2.8.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0104d3bbcbf407a2c08ab36e92eae47e0b77051ea1e86f88d9d0f3af8a6ad34d
|
4
|
+
data.tar.gz: 0f3f118e8f685735c6f50f1ab2c9d389f539ca3695507192136f4d279c8fec57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 042f8d47fe357e87f643a1748f76b675f2ec098a7e105037b998f71e3192d28d801d6f67fd09c4e6902240f7841d882a2aaea58d0570cb87f5fcc9b35458e6c2
|
7
|
+
data.tar.gz: 48bbdf33832cbec83891c5466483e284029042a87b6809913ee5f2c89ae980a5006bf1285ba69c6f25bb8686f820a00542160ff49ca22a478634a5b83127a08b
|
@@ -85,7 +85,8 @@ module RubyEventStore
|
|
85
85
|
stream = @event_klass
|
86
86
|
stream = stream.where(event_id: spec.with_ids) if spec.with_ids?
|
87
87
|
stream = stream.where(event_type: spec.with_types) if spec.with_types?
|
88
|
-
stream =
|
88
|
+
stream = stream.order(as_at(spec)) if spec.time_sort_by_as_at?
|
89
|
+
stream = stream.order(as_of(spec)) if spec.time_sort_by_as_of?
|
89
90
|
stream = stream.limit(spec.limit) if spec.limit?
|
90
91
|
stream = stream.where(start_condition_in_global_stream(spec)) if spec.start
|
91
92
|
stream = stream.where(stop_condition_in_global_stream(spec)) if spec.stop
|
@@ -97,29 +98,27 @@ module RubyEventStore
|
|
97
98
|
else
|
98
99
|
stream = @stream_klass.preload(:event).where(stream: spec.stream.name)
|
99
100
|
stream = stream.where(event_id: spec.with_ids) if spec.with_ids?
|
100
|
-
stream = stream.where(@event_klass.table_name => { event_type: spec.with_types }) if spec.with_types?
|
101
|
-
stream =
|
101
|
+
stream = stream.joins(:event).where(@event_klass.table_name => { event_type: spec.with_types }) if spec.with_types?
|
102
|
+
stream = stream.joins(:event).order(as_at(spec)) if spec.time_sort_by_as_at?
|
103
|
+
stream = stream.joins(:event).order(as_of(spec)) if spec.time_sort_by_as_of?
|
102
104
|
stream = stream.order(id: order(spec))
|
103
105
|
stream = stream.limit(spec.limit) if spec.limit?
|
104
106
|
stream = stream.where(start_condition(spec)) if spec.start
|
105
107
|
stream = stream.where(stop_condition(spec)) if spec.stop
|
106
|
-
stream = stream.where(older_than_condition(spec)) if spec.older_than
|
107
|
-
stream = stream.where(older_than_or_equal_condition(spec)) if spec.older_than_or_equal
|
108
|
-
stream = stream.where(newer_than_condition(spec)) if spec.newer_than
|
109
|
-
stream = stream.where(newer_than_or_equal_condition(spec)) if spec.newer_than_or_equal
|
108
|
+
stream = stream.joins(:event).where(older_than_condition(spec)) if spec.older_than
|
109
|
+
stream = stream.joins(:event).where(older_than_or_equal_condition(spec)) if spec.older_than_or_equal
|
110
|
+
stream = stream.joins(:event).where(newer_than_condition(spec)) if spec.newer_than
|
111
|
+
stream = stream.joins(:event).where(newer_than_or_equal_condition(spec)) if spec.newer_than_or_equal
|
110
112
|
stream
|
111
113
|
end
|
112
114
|
end
|
113
115
|
|
114
|
-
def
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
else
|
121
|
-
stream
|
122
|
-
end
|
116
|
+
def as_of(spec)
|
117
|
+
Arel.sql("COALESCE(#{@event_klass.table_name}.valid_at, #{@event_klass.table_name}.created_at) #{order(spec)}")
|
118
|
+
end
|
119
|
+
|
120
|
+
def as_at(spec)
|
121
|
+
"#{@event_klass.table_name}.created_at #{order(spec)}"
|
123
122
|
end
|
124
123
|
|
125
124
|
def start_offset_condition(specification, record_id, search_in)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_event_store-active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkency
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby_event_store
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.8.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.8.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|