eventsimple 1.7.0 → 1.7.1

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: 953514829adab38f167e1d3e64ca57121c701b868f18474924ce1252797d3670
4
+ data.tar.gz: 02eebc6041d3404c885be084e01f3c1106687c677f9bc3de01853736c4f57590
5
5
  SHA512:
6
- metadata.gz: a2cd191a5940f13eaa79cd75b2cf4285a52f34e35b5b463ac568ceebca6c2f2c804b99c329bb622c4dd8e368a6a7bfe671cd248f4a62493aa59a81de11b9f4cc
7
- data.tar.gz: 80a78a2b932b5c3784432bf66a731f169ac70f161bc1330d63d70ad642cc005eea3f8fc640416121a7bb8f21f1de65cf68062686843ac39ff3dc0898c1200a49
6
+ metadata.gz: 21bc4fe5dd6730a6b08fe397be3e1371c3b6aec61318bdd5ea1fa617889172f8b417d5b3aef1459e0d496ef3db416cb564622319dc6a585f557052043d5f68e5
7
+ data.tar.gz: f5acaa45ac8d2ac9e0e10cd9e97e3c686c3cb05a3d3e198b24283848438ae65114503ff081566c7cd150d697c895ca77da4825cee558a8b27704a2ead8b86fbd
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
+ ## 1.7.1 - 2025-08-22
10
+ ### Changed
11
+ - Use `model.unscoped` in Eventsimple UI to show soft-deleted records
12
+
9
13
  ## 1.7.0 - 2025-06-27
10
14
  ### Changed
11
15
  - 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.1)
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
 
@@ -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.1'
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zulfiqar Ali