ruby_event_store 0.3.0 → 0.3.1

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: 029ad3dcd5fb3e1b025f0702bcb48cf0ed96e5cb
4
- data.tar.gz: 958e78c130cc76ebffbfa341016f3f0673796d98
3
+ metadata.gz: 69546ce0878a7fa65749f566b540daa5c95208d2
4
+ data.tar.gz: d61f323dfcf883a093c30fb0c4fb38bdfb83efe5
5
5
  SHA512:
6
- metadata.gz: 9039b6d85500d4635fcc2331dcae5989defa2d8f6eda64f6f4f8e0e5b501a04f483f7f74705fe4a7a7ca69ed99164b9c1f16ec3a288216a4886cc15b535a776d
7
- data.tar.gz: 96e7bc7166c8e0bd9b86277c273a90cd8643f07360b5dbf017087f3e00606fb66706f3a5c1005cf051345c382122ec0604d9248f78ae24b3817b28b1b15ff061
6
+ metadata.gz: f7c10b9e99f4bfa6ceb29851f712defbe399219977e221770acd72e5f0669d0095cb51d9ae618933dcc6c92e0d1b2ba8a79dd0e6e95911441c35a5177a85d100
7
+ data.tar.gz: c00e2dc24868728c5c1fbd468a11eb446e5c63ab70187f24274b8ea6485082e0ed0ebf50809244e2e0572d644310b91df89783f41d19ff97e03598970313a9cc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ### HEAD
2
2
 
3
+ ### 0.3.1 (13.03.2016)
4
+
5
+ * Fix Don't overwrite timestamps when reading from repository
6
+
3
7
  ### 0.3.0 (03.03.2016)
4
8
 
5
9
  * Change: read_all_streams won't group_by results by stream name PR #4
@@ -10,8 +10,9 @@ module RubyEventStore
10
10
 
11
11
  @event_type = args[:event_type] || event_name
12
12
  @event_id = (args[:event_id] || generate_id).to_s
13
- @metadata = (args[:metadata] || {}).merge!(timestamp)
13
+ @metadata = args[:metadata] || {}
14
14
  @data = attributes(args)
15
+ @metadata[:timestamp] ||= Time.now.utc
15
16
  end
16
17
  attr_reader :event_type, :event_id, :metadata, :data
17
18
 
@@ -24,16 +25,16 @@ module RubyEventStore
24
25
  }
25
26
  end
26
27
 
28
+ def timestamp
29
+ metadata[:timestamp]
30
+ end
31
+
27
32
  private
28
33
 
29
34
  def attributes(args)
30
35
  args.reject { |k| [:event_type, :event_id, :metadata].include? k }
31
36
  end
32
37
 
33
- def timestamp
34
- { timestamp: Time.now.utc }
35
- end
36
-
37
38
  def generate_id
38
39
  SecureRandom.uuid
39
40
  end
@@ -1,3 +1,3 @@
1
1
  module RubyEventStore
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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-03 00:00:00.000000000 Z
12
+ date: 2016-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler