nuntius 1.4.6 → 1.4.7
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60ba6bdae28e285f54ae11261866c96857711e32dc2d8f066a39f01acfff444f
|
|
4
|
+
data.tar.gz: f0044e290dc4e32eee2eb7ce024e74325aa437846b304920f2d31d1f211e43d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05ba146b1ee291c41819bef8041ed961c6c93c52ffa0474e9522e9e2e5a37657427d61aca8bb387233c6c1c3f641189113dcdd986bfa8f0a1fe137e4266be607
|
|
7
|
+
data.tar.gz: d23e9470ad3bc65cc2b1a0f3134d5f45367afcabd152d3e936998142edf67e91a22122fa8b712b3fc49710e609804cc8ce62c7e96d0e99d2f4c2db71acdfe12d
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
# Initializes the appropriate Messenger class and calls the event method
|
|
4
4
|
module Nuntius
|
|
5
5
|
class MessengerJob < ApplicationJob
|
|
6
|
-
after_perform :cleanup_nuntius_events
|
|
7
|
-
|
|
8
6
|
def perform(obj, event, params = {})
|
|
9
7
|
return unless obj
|
|
10
8
|
|
|
@@ -19,12 +17,5 @@ module Nuntius
|
|
|
19
17
|
messenger.dispatch(templates) if templates.exists?
|
|
20
18
|
end
|
|
21
19
|
end
|
|
22
|
-
|
|
23
|
-
def cleanup_nuntius_events
|
|
24
|
-
Nuntius::Event.where(
|
|
25
|
-
transitionable: arguments.first,
|
|
26
|
-
transition_event: arguments.second.to_s
|
|
27
|
-
).delete_all
|
|
28
|
-
end
|
|
29
20
|
end
|
|
30
21
|
end
|
|
@@ -31,10 +31,15 @@ module Nuntius
|
|
|
31
31
|
|
|
32
32
|
def dispatch_nuntius_events
|
|
33
33
|
Nuntius::Event
|
|
34
|
-
.where(transitionable_type: self.class.name,transitionable_id:
|
|
34
|
+
.where(transitionable_type: self.class.name, transitionable_id: id)
|
|
35
35
|
.includes(:transitionable)
|
|
36
|
-
.select(:transition_event, :transitionable_type, :transitionable_id).distinct.each do |event|
|
|
36
|
+
.select(:transition_event, :transition_attribute, :transitionable_type, :transitionable_id).distinct.each do |event|
|
|
37
37
|
Nuntius.event(event.transition_event.to_sym, event.transitionable)
|
|
38
|
+
|
|
39
|
+
# Immediately cleanup the events after dispatching
|
|
40
|
+
Nuntius::Event.where(transitionable_type: self.class.name, transitionable_id: id,
|
|
41
|
+
transition_event: event.transition_event.to_s,
|
|
42
|
+
transition_attribute: event.transition_attribute).delete_all
|
|
38
43
|
end
|
|
39
44
|
end
|
|
40
45
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class ChangeNuntiusEventsId < ActiveRecord::Migration[8.1]
|
|
2
|
+
def change
|
|
3
|
+
execute "DELETE FROM public.nuntius_events;"
|
|
4
|
+
add_column :nuntius_events, :uuid, :uuid, default: "gen_random_uuid()", null: false
|
|
5
|
+
|
|
6
|
+
change_table :nuntius_events do |t|
|
|
7
|
+
t.remove :id
|
|
8
|
+
t.rename :uuid, :id
|
|
9
|
+
end
|
|
10
|
+
execute "ALTER TABLE nuntius_events ADD PRIMARY KEY (id);"
|
|
11
|
+
end
|
|
12
|
+
end
|
data/lib/nuntius/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nuntius
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom de Grunt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: apnotic
|
|
@@ -558,6 +558,7 @@ files:
|
|
|
558
558
|
- db/migrate/20240206203019_add_slug_to_nuntius_list.rb
|
|
559
559
|
- db/migrate/20250520091916_create_nuntius_events_table.rb
|
|
560
560
|
- db/migrate/20250521132554_update_nuntius_events_index.rb
|
|
561
|
+
- db/migrate/20260123160443_change_nuntius_events_id.rb
|
|
561
562
|
- lib/generators/nuntius/install_generator.rb
|
|
562
563
|
- lib/generators/nuntius/tailwind_config_generator.rb
|
|
563
564
|
- lib/generators/nuntius/templates/config/initializers/nuntius.rb
|