rails_event_store 0.3.1 → 0.4.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
  SHA1:
3
- metadata.gz: aa26b8a3717971f1afa60156acc00ab923afa23a
4
- data.tar.gz: 57fe9dbe77da534ff9e4942c59a93ec5b65c9406
3
+ metadata.gz: 973d877e37b189c827d69a236d0d2e449ba2dba7
4
+ data.tar.gz: cd84e29ae4d6f6c83c59e3cf04131db23bc79df9
5
5
  SHA512:
6
- metadata.gz: 51aae4549abe762524d6fbc004c01343381cdaec57d40a92020ca2ec6efc9eeb52f3f9cd3ea525a70f56ae25b2cffc893528fd7e8a84ef31610a5e817882f36e
7
- data.tar.gz: 2844fdc798fc2aefd6ec0d3b7042a7ef240b0baeac3a5a971fedb195007db21852dbd31e57acc73f370f3b683b0e112730ea5f7d43b81ad6a0aac158c09e5d8a
6
+ metadata.gz: 54f3527b8d578ebb523689e40af16bb7b873ca1ac1309c3f7a039d8280565517a4776e2bca9335c5ec14ef167fdc983c2223ccc8f7bbdb830ec0a79350d31d2a
7
+ data.tar.gz: 9e560f7aa0714965fe5c00b3ae81a7398e210fc8fc6f053d853ef3cc8de92c8f9c3ada9ec9c45bc747617184f8ed495c5a3e81f27dae5e02dba27d0005787842
@@ -1,5 +1,10 @@
1
1
  ### HEAD
2
2
 
3
+ ### 0.4.0 (17.03.2016)
4
+
5
+ * Change: Use class names to subscribe events (ruby_event_store update to 0.4.0)
6
+ * Change: EventRepository now recreate events using orginal classes
7
+
3
8
  ### 0.3.1 (13.03.2016)
4
9
 
5
10
  * Update to ruby_event_store 0.3.1 - fix changing timestamp on reads from repository
data/README.md CHANGED
@@ -184,7 +184,7 @@ end
184
184
 
185
185
  ```ruby
186
186
  invoice = InvoiceReadModel.new
187
- client.subscribe(invoice, ['PriceChanged', 'ProductAdded'])
187
+ client.subscribe(invoice, [PriceChanged, ProductAdded])
188
188
  ```
189
189
 
190
190
  * You can also listen on all incoming events
@@ -26,7 +26,7 @@ module RailsEventStore
26
26
  attr_reader :webhook_url, :http_client
27
27
 
28
28
  def handle_event(event)
29
- event_name = event.event_type
29
+ event_name = event.class.name
30
30
  payload = {
31
31
  text: "Event #{event_name} raised.",
32
32
  username: "Rails EventStore Bot",
@@ -89,12 +89,13 @@ module RailsEventStore
89
89
 
90
90
  def build_event_entity(record)
91
91
  return nil unless record
92
- ::RailsEventStore::Event.new(record.data.merge(
93
- event_type: record.event_type,
94
- event_id: record.event_id,
95
- metadata: record.metadata))
92
+ record.event_type.constantize.new(
93
+ record.data.merge(
94
+ event_id: record.event_id,
95
+ metadata: record.metadata
96
+ )
97
+ )
96
98
  end
97
-
98
99
  end
99
100
  end
100
101
  end
@@ -1,3 +1,3 @@
1
1
  module RailsEventStore
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'webmock', '~> 1.21'
27
27
  spec.add_development_dependency 'sqlite3'
28
28
 
29
- spec.add_dependency 'ruby_event_store', '~> 0.3.1'
29
+ spec.add_dependency 'ruby_event_store', '~> 0.4.0'
30
30
  spec.add_dependency 'aggregate_root', '~> 0'
31
31
  spec.add_dependency 'activesupport', '>= 3.0'
32
32
  spec.add_dependency 'activemodel', '>= 3.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rybex
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-03-13 00:00:00.000000000 Z
12
+ date: 2016-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 0.3.1
118
+ version: 0.4.0
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 0.3.1
125
+ version: 0.4.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: aggregate_root
128
128
  requirement: !ruby/object:Gem::Requirement