event_store_client 1.0.5 → 1.0.6

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: db502b71c397ab4b8342c126ebe161fa9fd6d3af0a22ba2ff4e17981a14542e2
4
- data.tar.gz: 666aac3c5b343ed350856ba8a2722de2586268fe88ed502c990e8c3fa986ffad
3
+ metadata.gz: 073a691ef952647fd7be92fad2526a279dccfe05867c524ccab6a86aee815dd2
4
+ data.tar.gz: 75c51d92577ceb57488e07761466dd58bf1b8cb52e23ee11a82d40bdfb387039
5
5
  SHA512:
6
- metadata.gz: 84c87f1c1980a22426c3db3c2809df9c375b249d0e59151f223a4e9789e16287407d6573f67bccbd56aef0ac1b4fa31649928f2b30247831ad6260c5204bbdb1
7
- data.tar.gz: 7e79bd96657215653d6abd573fb2c11f500a97caff0f17270421511ee0a58b66f30dfa69dcfb8d389de008a887458663a554ce8f4216ae514666a3041f87d4a0
6
+ metadata.gz: c9ba15429219f65fc9a7473642ff2e7a0c048cf14a0246f00ecac62ad5daf38ab9c0a800993911d14cd142706ec1d3f5e233e092279391c7c7d9d43683468a05
7
+ data.tar.gz: 27f4088d4e92c6a0cef51a93970559a4253d44789e5d9c3a744afebc59de027f3f1853e0c527de5438ede1031bd5cf9ad36aff2e6f8f82856202c23a45b47025
@@ -50,13 +50,21 @@ module EventStoreClient
50
50
  def deserialize_event(entry)
51
51
  id = entry.id.string
52
52
  id = SecureRandom.uuid if id.nil? || id.empty?
53
+
54
+ data = (entry.data.nil? || entry.data.empty?) ? '{}' : entry.data
55
+
56
+ metadata =
57
+ JSON.parse(entry.custom_metadata || '{}').merge(
58
+ entry.metadata.to_h || {}
59
+ ).to_json
60
+
53
61
  config.mapper.deserialize(
54
62
  EventStoreClient::Event.new(
55
63
  id: id,
56
64
  title: "#{entry.stream_revision}@#{entry.stream_identifier.streamName}",
57
65
  type: entry.metadata['type'],
58
- data: entry.data || '{}',
59
- metadata: (entry.metadata.to_h || {}).to_json
66
+ data: data,
67
+ metadata: metadata
60
68
  )
61
69
  )
62
70
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_store_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Wilgosz