eventsimple 2.0.5 → 2.0.6

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: 3a3f4de19c913cc2e73881487322d51d423e45436d21ae6c07414be85db29812
4
- data.tar.gz: 56ac8cbbba8edab5517173f44990e0d266f9e10e3509af4101b03c1c8447acf0
3
+ metadata.gz: 90658d4182be4644e8885e2988333d4fdd6d7954bce1327087d3746c620a9d1e
4
+ data.tar.gz: ace638b47a463155a8adaa9a8713bd793e2be400466685ba777b74b928b02a4d
5
5
  SHA512:
6
- metadata.gz: 85475e87582cc5b81f8562abc340063c511db6924e8dd319875d9fefc6032933847e46e01634b3070fe83dc711f380e89625fd8aa77a02135948e78e43d4d424
7
- data.tar.gz: 1c9dca4e6e7d499e796e6afaee8949f4c6f92c1a80d7fa26ae688b6e6097bd685e2617ca133386699ee805136df2c88efdb721287c80ac9745b07c6ddf99eec4
6
+ metadata.gz: 2eb305aa101f86076f12634f2d46b75f67f7acdade90bcf7ac79feae8babfcaa795a7406ccd4999f08745b6db23de62efd56e6017c27544811bd5d1fc8a1dbb0
7
+ data.tar.gz: b2bf21fdfc3ab8df167276148b69c933d2df87d44bb803bdc6620b011062428ea61c1e20920531bc056c19efb55cf1323114df71c3010f4943bb4ae4b8a0ff4d
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 2.0.6 - 2026-01-29
10
+ ### Fixed
11
+ - Fix `projection_matches_events?` returning false due to timestamp precision differences between Ruby (nanoseconds) and PostgreSQL (microseconds). Time attributes are now normalized to microsecond precision before comparison.
12
+
9
13
  ## 2.0.5 - 2026-01-14
10
14
  ### Changed
11
15
  - Events can now load their aggregate even when the aggregate model has a default_scope. The association reader bypasses default_scope using unscoped queries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventsimple (2.0.5)
4
+ eventsimple (2.0.6)
5
5
  concurrent-ruby (>= 1.2.3)
6
6
  dry-struct (>= 1.8.0)
7
7
  dry-types (>= 1.7.0)
@@ -53,9 +53,21 @@ module Eventsimple
53
53
  def projection_matches_events?
54
54
  reprojected = self.class.unscoped.find(id).reproject
55
55
 
56
- attributes == reprojected.attributes
56
+ normalize_times(attributes) == normalize_times(reprojected.attributes)
57
57
  end
58
58
 
59
+ private
60
+
61
+ # Normalize time values to microsecond precision to match PostgreSQL storage.
62
+ # This prevents false mismatches due to Ruby's nanosecond vs PostgreSQL's microsecond precision.
63
+ def normalize_times(attrs)
64
+ attrs.transform_values do |value|
65
+ value.is_a?(Time) ? value.change(nsec: value.usec * 1000) : value
66
+ end
67
+ end
68
+
69
+ public
70
+
59
71
  def enable_writes!(&block)
60
72
  was_readonly = @readonly
61
73
  @readonly = false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eventsimple
4
- VERSION = '2.0.5'
4
+ VERSION = '2.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventsimple
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zulfiqar Ali