evt-entity_snapshot-postgres 0.2.3.0 → 0.2.3.1

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: a4830021eb2636549b9ee6e4c57b8dcafe0c918e9de922e65f3159bc8becf7d7
4
- data.tar.gz: e5cfa201fc1e1cf6c923788d0c47cd9fca7dc82421ce988258e1ce29a36bf00c
3
+ metadata.gz: 5f1e45522e538e0899350fe315e1a0d47c4c6768d25696a99e7359bfc9b1d893
4
+ data.tar.gz: 3ebb45c7ad6f536ee1e32c12184adff0f54da166634fa89debc2704188258a97
5
5
  SHA512:
6
- metadata.gz: d65b464f31d3eed81d07884eba68387e2d434a3459b8ed2ff8229b81caf6936d1942a18870553fa7f152e00db61d53c221ec1f0b34758a5ba736842ce13fab03
7
- data.tar.gz: d5f51acbd3de3b1b3b2fccb81b4e88fec018172ac8ce44d69c37ba1a02434ef9aea97cec7b39b75f3ac97b99595fd2ca0bb048c97722184fe5914bc603d9f1a5
6
+ metadata.gz: '09a6795bc10563650e66d7b964c9e8843f6f3a5f319de9fceea702c86807171d52d937f2f6b8856c3bba5f680b575787d493d34bb9ebc68f77adad2c5ff25df9'
7
+ data.tar.gz: 02f88f8c95d31b2919a45e06b77f2bcced6423a08171f200586d34f2be731bfc081f0a96bb76768f5dbd00b83d96091000c9a065229c188316ea0c5d4eaa2432
@@ -0,0 +1 @@
1
+ lib/entity_snapshot/postgres.rb
@@ -24,7 +24,17 @@ module EntitySnapshot
24
24
  entity = Transform::Read.instance(entity_data, entity_class)
25
25
 
26
26
  version = event_data.data[:entity_version]
27
- time = event_data.time
27
+
28
+ time = event_data.data[:time]
29
+
30
+ # Backward compatibility for messages not written with
31
+ # a timestamp in the message data
32
+ # Sat Oct 13, Scott Bellware
33
+ if time.nil?
34
+ time ||= event_data.time
35
+ else
36
+ time = Time.parse(time)
37
+ end
28
38
 
29
39
  logger.debug(tags: [:snapshot, :cache, :get]) { "Read snapshot (Stream: #{stream_name.inspect}, Entity Class: #{entity_class.name}, Version: #{version.inspect}, Time: #{time.utc.iso8601(3)})" }
30
40
 
@@ -41,9 +41,12 @@ module EntitySnapshot
41
41
 
42
42
  event_data = MessageStore::MessageData::Write.new
43
43
 
44
+ iso8601_time = Clock::UTC.iso8601(time)
45
+
44
46
  data = {
45
47
  entity_data: entity_data,
46
- entity_version: version
48
+ entity_version: version,
49
+ time: iso8601_time
47
50
  }
48
51
 
49
52
  event_data.type = 'Recorded'
@@ -4,7 +4,6 @@ require 'messaging/postgres'
4
4
  require 'entity_store'
5
5
 
6
6
  require 'entity_snapshot/postgres/log'
7
- require 'entity_snapshot/postgres/recorded'
8
7
 
9
8
  require 'entity_snapshot/postgres/stream_name'
10
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-entity_snapshot-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.0
4
+ version: 0.2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2018-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-entity_store
@@ -58,6 +58,7 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - lib/entity_snapshot/loader.rb
61
62
  - lib/entity_snapshot/postgres.rb
62
63
  - lib/entity_snapshot/postgres/controls.rb
63
64
  - lib/entity_snapshot/postgres/controls/batch.rb
@@ -77,7 +78,6 @@ files:
77
78
  - lib/entity_snapshot/postgres/log.rb
78
79
  - lib/entity_snapshot/postgres/postgres.rb
79
80
  - lib/entity_snapshot/postgres/read_only.rb
80
- - lib/entity_snapshot/postgres/recorded.rb
81
81
  - lib/entity_snapshot/postgres/stream_name.rb
82
82
  homepage: https://github.com/eventide-project/entity-snapshot-postgres
83
83
  licenses:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.7.6
102
+ rubygems_version: 2.7.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Projected entity snapshotting for Postgres
@@ -1,8 +0,0 @@
1
- module EntitySnapshot
2
- class Recorded
3
- include Messaging::Message
4
-
5
- attribute :entity_data
6
- attribute :entity_version
7
- end
8
- end