sequent 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sequent/core/command_record.rb +12 -3
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca3d6818a1c912f76eede51d1e1f9b2d48495a3b9389ac9489c47d0f19d265b0
|
4
|
+
data.tar.gz: f585df2b0e6cc467d4a50ca4e4535c4d0ac92a41cdb575b40f24a738bbf199f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f63fa751186bf3b70953edf6ad2ea25f805d045635b0e87d67adf4095a3b93a7393de670b7b3d11690b74dbd4e7e73e448028cddabea95c7a4ad865a7bdb642
|
7
|
+
data.tar.gz: 3460f5e14637cbc95d101d78b4204d5dfa2d1c1b4aba7b7c9b76183408a448ae83f3b0c79b9bb452f83971802f4b4a3f3280557dce4dd31fc54ab9c79c600b83
|
@@ -13,12 +13,21 @@ module Sequent
|
|
13
13
|
def command=(command)
|
14
14
|
self.created_at = command.created_at
|
15
15
|
self.aggregate_id = command.aggregate_id if command.respond_to? :aggregate_id
|
16
|
-
self.organization_id = command.organization_id if command.respond_to? :organization_id
|
17
16
|
self.user_id = command.user_id if command.respond_to? :user_id
|
18
17
|
self.command_type = command.class.name
|
19
18
|
self.command_json = Sequent::Core::Oj.dump(command.attributes)
|
20
|
-
|
21
|
-
|
19
|
+
|
20
|
+
# optional attributes (here for historic reasons)
|
21
|
+
# this should be moved to a configurable CommandSerializer
|
22
|
+
self.organization_id = command.organization_id if serialize_attribute?(command, :organization_id)
|
23
|
+
self.event_aggregate_id = command.event_aggregate_id if serialize_attribute?(command, :event_aggregate_id)
|
24
|
+
self.event_sequence_number = command.event_sequence_number if serialize_attribute?(command, :event_sequence_number)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def serialize_attribute?(command, attribute)
|
30
|
+
[self, command].all? { |obj| obj.respond_to?(attribute) }
|
22
31
|
end
|
23
32
|
end
|
24
33
|
|
data/lib/version.rb
CHANGED