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 +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/app/controllers/eventsimple/entities_controller.rb +1 -1
- data/app/controllers/eventsimple/models_controller.rb +8 -8
- data/lib/eventsimple/entity.rb +1 -1
- data/lib/eventsimple/event.rb +2 -2
- data/lib/eventsimple/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc464f934ef8a1b78864880d3b8e1ed8702d27adbec453375841017006b8edf
|
4
|
+
data.tar.gz: 37bf38abbc22d948bebd500944fc3f4392da1a9e3423bfc47db02a7764cee21e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
27
|
-
model_event_class = model_event_class.joins(
|
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({
|
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
|
|
data/lib/eventsimple/entity.rb
CHANGED
@@ -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::
|
21
|
+
rescue ActiveRecord::AdapterError
|
22
22
|
# skip checks if the database is not yet created
|
23
23
|
end
|
24
24
|
|
data/lib/eventsimple/event.rb
CHANGED
@@ -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::
|
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(
|
52
|
+
default_scope { order(:created_at) }
|
53
53
|
|
54
54
|
before_validation :extend_validation
|
55
55
|
after_validation :perform_transition_checks
|
data/lib/eventsimple/version.rb
CHANGED