eventsimple 2.0.1 → 2.0.3

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: 7ef0bd1c392a5de3db450d1ba8f29a933ec2fd885ff2c5cc170b0b9e661788ea
4
- data.tar.gz: 0ccb0b0a628c852c4a79077a7659e179be9b16e3bef54b3b09d30f102892763e
3
+ metadata.gz: d72072b70e9962eb4e340513ea94a5f68bc0e9c3e80555a0ddf7ed188d990888
4
+ data.tar.gz: d42eb9077fda2bd8cd450a1198314dfe6e06ea7aa450af2b2d2c21f9349ccbda
5
5
  SHA512:
6
- metadata.gz: cbb0c7fe1c90d56ea050ee03ccac8b29e2180842b43fdafe6c91e73d76fe5d92ba6caee5dd401260da63525bd67612f7d27c9c6896594c77cf1e1e98e78cc1c8
7
- data.tar.gz: f874bffb16acb3a98c90d1b7f525614fb6611554c2931f3cb20009ef60ef4dd22750d007fba7cbe1d5d37b462a6bdd47e471f3f3b91afed1367fb72d0c31b57a
6
+ metadata.gz: 043c3b0f6383c2b25729a721986454398d6fabd0a51444b4e0f5f3a9664bdd562730942fd5549e09c00ca8cb2c051813657e667ce9be68fe93c90cc8a512768a
7
+ data.tar.gz: dfefe25f7cd94473700ac4802e93234cef7d0b2d69621163b2f91de3380982bbe23df95735fa5ea4123e5b775db3fbd17ed24e91a58df73f9c3d371dea0c887e
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 2.0.3 - 2025-12-12
10
+ ### Changed
11
+ - Fix false positive deprecation warnings when using Message as an optional attribute type.
12
+
13
+ ## 2.0.2 - 2025-12-12
14
+ ### Changed
15
+ - Fix UI event loading issue.
16
+
9
17
  ## 2.0.1 - 2025-12-11
10
18
  ### Changed
11
19
  - Switch back to using dry-struct for Message class, for better compatibility with existing code.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventsimple (2.0.1)
4
+ eventsimple (2.0.3)
5
5
  concurrent-ruby (>= 1.2.3)
6
6
  dry-struct (>= 1.8.0)
7
7
  dry-types (>= 1.7.0)
@@ -10,7 +10,7 @@ module Eventsimple
10
10
  @tab_id = params[:t] == 'event' ? 'event' : 'entity'
11
11
 
12
12
  filter_columns = @model_class._filter_attributes
13
- params_filters = params.permit(filters: {})[:filters] || {}
13
+ params_filters = params.permit(filters: filter_columns).fetch(:filters, {})
14
14
  @filters = filter_columns.index_with { |column| params_filters[column] }
15
15
 
16
16
  primary_key = @model_class.event_class._aggregate_id
@@ -19,7 +19,7 @@ module Eventsimple
19
19
  def apply_filter(model_class, model_event_class)
20
20
  filter_columns = model_class._filter_attributes
21
21
 
22
- params_filters = params.permit(filters: {})[:filters] || {}
22
+ params_filters = params.permit(filters: filter_columns).fetch(:filters, {})
23
23
  @filters = filter_columns.index_with { |column| params_filters[column] }
24
24
 
25
25
  return model_event_class unless @filters.values.any?(&:present?)
@@ -61,7 +61,7 @@
61
61
  <th scope="row" colspan="2">Data</th>
62
62
  </tr>
63
63
  <% if @selected_event.data.present? %>
64
- <% @selected_event.data.attributes.each do |attr_name, attr_value| %>
64
+ <% @selected_event.data.to_h.each do |attr_name, attr_value| %>
65
65
  <tr>
66
66
  <td>&nbsp;&nbsp;&nbsp;&nbsp;<%= attr_name %></td>
67
67
  <td><code class="entity-property"><%= attr_value %></code></td>
@@ -72,7 +72,7 @@
72
72
  <tr>
73
73
  <th scope="row" colspan="2">Metadata</th>
74
74
  </tr>
75
- <% @selected_event.metadata.attributes.each do |attr_name, attr_value| %>
75
+ <% @selected_event.metadata.to_h.each do |attr_name, attr_value| %>
76
76
  <tr>
77
77
  <td>&nbsp;&nbsp;&nbsp;&nbsp;<%= attr_name %></td>
78
78
  <td><code class="entity-property">: <%= attr_value %></code></td>
@@ -4,7 +4,7 @@ module Eventsimple
4
4
  class Configuration
5
5
  attr_reader :max_concurrency_retries
6
6
  attr_writer :metadata_klass, :parent_record_klass
7
- attr_accessor :retry_reactor_on_record_not_found, :ui_visible_models
7
+ attr_accessor :retry_reactor_on_record_not_found, :ui_visible_model_names
8
8
 
9
9
  def initialize
10
10
  @dispatchers = []
@@ -13,7 +13,13 @@ module Eventsimple
13
13
  @parent_record_klass = 'ApplicationRecord'
14
14
  @retry_reactor_on_record_not_found = false
15
15
 
16
- @ui_visible_models = [] # internal use only
16
+ @ui_visible_model_names = [] # internal use only - stores class names as strings
17
+ end
18
+
19
+ # Returns fresh class objects by constantizing stored names
20
+ # This avoids stale class references after code reload in development
21
+ def ui_visible_models
22
+ @ui_visible_model_names.map(&:constantize)
17
23
  end
18
24
 
19
25
  def max_concurrency_retries=(value)
@@ -43,7 +43,7 @@ module Eventsimple
43
43
  # disable automatic timestamp updates
44
44
  self.record_timestamps = false
45
45
 
46
- Eventsimple.configuration.ui_visible_models |= [self]
46
+ Eventsimple.configuration.ui_visible_model_names |= [name]
47
47
 
48
48
  include InstanceMethods
49
49
  extend ClassMethods
@@ -33,6 +33,10 @@ module Eventsimple
33
33
  end
34
34
 
35
35
  class << self
36
+ def optional
37
+ super.meta(Eventsimple::Types::EVENTSIMPLE_META)
38
+ end
39
+
36
40
  def validate_type(type)
37
41
  return if valid_eventsimple_type?(type)
38
42
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eventsimple
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.3'
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.1
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zulfiqar Ali