eventsimple 1.7.0 → 1.7.2

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: 6c0e02b9b7b00100a888407cfd7dfb4422f468fb2ee7807d0a174996be66d12d
4
- data.tar.gz: 89f100e610caeff2b34d2a0a67b934e701845548007bacbef0d814f221f7c7bc
3
+ metadata.gz: dbc464f934ef8a1b78864880d3b8e1ed8702d27adbec453375841017006b8edf
4
+ data.tar.gz: 37bf38abbc22d948bebd500944fc3f4392da1a9e3423bfc47db02a7764cee21e
5
5
  SHA512:
6
- metadata.gz: a2cd191a5940f13eaa79cd75b2cf4285a52f34e35b5b463ac568ceebca6c2f2c804b99c329bb622c4dd8e368a6a7bfe671cd248f4a62493aa59a81de11b9f4cc
7
- data.tar.gz: 80a78a2b932b5c3784432bf66a731f169ac70f161bc1330d63d70ad642cc005eea3f8fc640416121a7bb8f21f1de65cf68062686843ac39ff3dc0898c1200a49
6
+ metadata.gz: c6c70d88a160ed3d905a94b6d52659d3cb60bc74ed38541f4d74e8932edc3e8498366af49729ee92a57e115a530f5cc79c00e456e298c1ac431c3b7c39dc5b0d
7
+ data.tar.gz: 620f758bb28c4775ade2f1af3e9e32c9c3826bdf1b93554d2c1626ce564449fcad2318e73651c47eceb7e3b1d823a52720955cf1587f914170ef9f0620cd51b3
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
+ ## 1.7.2 - 2025-08-28
10
+ ### Changed
11
+ - Rescue `ActiveRecord::AdapterError` in Entity and Event validation
12
+
13
+ ## 1.7.1 - 2025-08-22
14
+ ### Changed
15
+ - Use `model.unscoped` in Eventsimple UI to show soft-deleted records
16
+
9
17
  ## 1.7.0 - 2025-06-27
10
18
  ### Changed
11
19
  - Verify optimistic locking column exists
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eventsimple (1.7.0)
4
+ eventsimple (1.7.2)
5
5
  concurrent-ruby (>= 1.2.3)
6
6
  dry-struct (~> 1.6)
7
7
  dry-types (~> 1.7)
@@ -14,7 +14,7 @@ module Eventsimple
14
14
  @filters = filter_columns.index_with { |column| params_filters[column] }
15
15
 
16
16
  primary_key = @model_class.event_class._aggregate_id
17
- @entity = @model_class.find_by!(primary_key => @aggregate_id)
17
+ @entity = @model_class.unscoped.find_by!(primary_key => @aggregate_id)
18
18
  @entity_event_history = @entity.events.reverse
19
19
 
20
20
  @selected_event = @entity_event_history.find { |e|
@@ -6,9 +6,10 @@ module Eventsimple
6
6
  @model_name = params[:name]
7
7
  model_class = event_classes.find { |d| d.name == @model_name }
8
8
 
9
- scope = apply_filter(model_class, model_class.event_class)
10
-
11
- @latest_entities = scope.last(20).reverse
9
+ model_class.unscoped do
10
+ scope = apply_filter(model_class, model_class.event_class)
11
+ @latest_entities = scope.last(20).reverse
12
+ end
12
13
 
13
14
  check_redirect_to_entity
14
15
  end
@@ -21,17 +22,16 @@ module Eventsimple
21
22
  params_filters = params.permit(filters: {})[:filters] || {}
22
23
  @filters = filter_columns.index_with { |column| params_filters[column] }
23
24
 
24
- return model_event_class unless @filters.any?
25
+ return model_event_class unless @filters.values.any?(&:present?)
25
26
 
26
- aggregate_class_symbol = model_event_class._aggregate_klass.model_name.element.to_sym
27
- model_event_class = model_event_class.joins(aggregate_class_symbol)
27
+ model_class_symbol = model_class.model_name.element.to_sym
28
+ model_event_class = model_event_class.joins(model_class_symbol)
28
29
  @filters.each do |key, value|
29
30
  next if value.blank?
30
31
 
31
32
  key = model_event_class._aggregate_id if key == :aggregate_id
32
- model_event_class = model_event_class.where({ aggregate_class_symbol => { key => value } })
33
+ model_event_class = model_event_class.where({ model_class_symbol => { key => value } })
33
34
  end
34
-
35
35
  model_event_class
36
36
  end
37
37
 
@@ -18,7 +18,7 @@ module Eventsimple
18
18
 
19
19
  raise ArgumentError, "column type mismatch - event:#{aggregate_column_type_in_event} entity:#{aggregate_column_type_in_entity}" if aggregate_column_type_in_event != aggregate_column_type_in_entity
20
20
  end
21
- rescue ActiveRecord::NoDatabaseError
21
+ rescue ActiveRecord::AdapterError
22
22
  # skip checks if the database is not yet created
23
23
  end
24
24
 
@@ -16,7 +16,7 @@ module Eventsimple
16
16
  raise ArgumentError, "column type mismatch - event:#{aggregate_column_type_in_event} entity:#{aggregate_column_type_in_entity}" if aggregate_column_type_in_event != aggregate_column_type_in_entity
17
17
 
18
18
  end
19
- rescue ActiveRecord::NoDatabaseError
19
+ rescue ActiveRecord::AdapterError
20
20
  # skip checks if the database is not yet created
21
21
  end
22
22
 
@@ -49,7 +49,7 @@ module Eventsimple
49
49
  autosave: false,
50
50
  validate: false
51
51
 
52
- default_scope { order('created_at ASC') }
52
+ default_scope { order(:created_at) }
53
53
 
54
54
  before_validation :extend_validation
55
55
  after_validation :perform_transition_checks
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eventsimple
4
- VERSION = '1.7.0'
4
+ VERSION = '1.7.2'
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: 1.7.0
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zulfiqar Ali