sequent 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19b4f1e046b49ceea7b79a7984ba2329905cdec74dc0ab31d02820752f051585
4
- data.tar.gz: 95cd39748cbe7b474c06f8556cd63e2cf548909d2d7e3aee23b794385fdfd2ca
3
+ metadata.gz: ca3d6818a1c912f76eede51d1e1f9b2d48495a3b9389ac9489c47d0f19d265b0
4
+ data.tar.gz: f585df2b0e6cc467d4a50ca4e4535c4d0ac92a41cdb575b40f24a738bbf199f2
5
5
  SHA512:
6
- metadata.gz: d8738ec3b038f058a873db7b8751706cf05112d376fa5053dcb8196c9f96f96a05dc1f61582c98f36415d40899ec05facb572c0f39d03ede1c303b28449614b5
7
- data.tar.gz: de81d600667fe597142ac81161b806a5eefbc92bc32fea8a3bb7f4f252bf5289d51fc1f55dbdf04ee62ac0eac37cda7175e0fc68ec7eddbe52d658a885b339a9
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
- self.event_aggregate_id = command.event_aggregate_id if command.respond_to? :event_aggregate_id
21
- self.event_sequence_number = command.event_sequence_number if command.respond_to? :event_sequence_number
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
@@ -1,3 +1,3 @@
1
1
  module Sequent
2
- VERSION = '3.2.0'
2
+ VERSION = '3.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequent
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Vonk