aggregate_root 0.42.0 → 0.43.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: 05c5403dadb28959f3f791f291fb74726020159dcdcc1e8a82da529f211f5f52
4
- data.tar.gz: 34b79c0e399c831f26dd1f0c78d3c7cdc0f2b2b10c295f1b7adb2b3b895066b8
3
+ metadata.gz: 6722a27002d1414528635db8339fe8a9d38f3c302a9a6aa20c0e7b744e8adc99
4
+ data.tar.gz: da630b00d7edc68443d36cdd708e73fa287e0f9db5ab482f37e02e2b00d0edb4
5
5
  SHA512:
6
- metadata.gz: 827638cf8ccb3470096665621703ee1260a877ff995cf16d03a30d6154c4c961cd989f7d55700fc3a0d323c8cdf4e7be596015382751d5b9edcf108a0711556f
7
- data.tar.gz: 0fe73ef842c1a487383ce58d31a95c7f40f4d7a3e54b8b161e832777c9f27b13cf6c67fb97bf434859ababdb6141c75b004c311e20e760937eefaf8147719aba
6
+ metadata.gz: f9d88d9b7d598db1d1cbb8266f7d86874271e6670767290657658d4cdc1993091e9600ed056a03d87d51d98b09453d67d11ade190c5fb31f66bafa364cce8d6a
7
+ data.tar.gz: 1ca037cc094889c0d213f84a59530c49974c5823df285389460ec1a5bd1c04d9f0bc2e39176ebb3f3f909366af5f9172d0e376849280b287018abbd8a7b3466b
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ['lib']
28
28
 
29
- spec.add_dependency 'ruby_event_store', '= 0.42.0'
29
+ spec.add_dependency 'ruby_event_store', '= 0.43.0'
30
30
  end
@@ -65,7 +65,7 @@ module AggregateRoot
65
65
  Module.new do
66
66
  def self.included(host_class)
67
67
  host_class.extend OnDSL
68
- host_class.include AggregateRoot.with_strategy(-> { DefaultApplyStrategy.new })
68
+ host_class.include AggregateRoot.with_strategy(->{ DefaultApplyStrategy.new })
69
69
  end
70
70
  end
71
71
  end
@@ -20,10 +20,14 @@ module AggregateRoot
20
20
  private
21
21
 
22
22
  def handler_name(aggregate, event)
23
- aggregate.class.on_methods.fetch(event.type) { handler_name_by_type(event.type) }
23
+ on_dsl_handler_name(aggregate, event.type) || apply_handler_name(event.type)
24
24
  end
25
25
 
26
- def handler_name_by_type(event_type)
26
+ def on_dsl_handler_name(aggregate, event_type)
27
+ aggregate.class.on_methods[event_type] if aggregate.class.respond_to?(:on_methods)
28
+ end
29
+
30
+ def apply_handler_name(event_type)
27
31
  "apply_#{Transform.to_snake_case(event_type(event_type))}"
28
32
  end
29
33
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AggregateRoot
4
- VERSION = "0.42.0"
4
+ VERSION = "0.43.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggregate_root
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.0
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-30 00:00:00.000000000 Z
11
+ date: 2020-02-26 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: 0.42.0
19
+ version: 0.43.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: 0.42.0
26
+ version: 0.43.0
27
27
  description: Event sourced (with Rails Event Store) aggregate root implementation
28
28
  email:
29
29
  - dev@arkency.com
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubygems_version: 3.0.6
69
+ rubygems_version: 3.0.3
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: Event sourced (with Rails Event Store) aggregate root implementation