nuntius 1.6.0 → 1.6.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: 7180b584a94828e410a42d835438c6cf31515fc9b4dde511b094ba2b4b03490d
4
- data.tar.gz: f1b864e4d6ccf58829584985c5eb2cac1135803780f542f8d604410b27ee0e69
3
+ metadata.gz: cdf58ba665e61a725d24a5b44548910f26dff54debf0dc58a0af46632f7e1af4
4
+ data.tar.gz: 309523efbd93975d09f6b5f956235026f22d666bc0dbcd17f104f7b06a267671
5
5
  SHA512:
6
- metadata.gz: 437e01c204f38b399332504ec8fa9179d7627973a87a25fa18739336d445b5212b7d53c02542f64445cd4b2a563280b46dcb0361f4e04fc10738da40510eaf81
7
- data.tar.gz: 5b4ad9324541e2110b012c84e71c08760331220ed999763f566ad6ede6e63c38078018ea1af8d2bdf2bdd9e6353d24321d7324553188210a29d58584cd90247b
6
+ metadata.gz: b6c1dbdaf3164b449072282fd8c4260b8b7fb3d9a42f8e41d075bff1d0d46b1cbfa0a3f5b10cc2ad4464d2dad29d6de968907eaf4b99f63b6229d6e3511567ab
7
+ data.tar.gz: 11d7233149ff42be1a57e0a6adc2e535893075f068e607fc01d78d3fdbf42864850e63547188fd3154ba69263058c76266f8686d10c117f10a3ec211b7fe04b6
@@ -34,12 +34,14 @@ module Nuntius
34
34
  .where(transitionable_type: self.class.name, transitionable_id: id)
35
35
  .includes(:transitionable)
36
36
  .select(:transition_event, :transition_attribute, :transitionable_type, :transitionable_id).distinct.each do |event|
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,
37
+ # Claim the events before dispatching: another commit of this object, in this process or
38
+ # another, may be dispatching them as well, and only the one that deletes them sends
39
+ claimed = Nuntius::Event.where(transitionable_type: self.class.name, transitionable_id: id,
41
40
  transition_event: event.transition_event.to_s,
42
41
  transition_attribute: event.transition_attribute).delete_all
42
+ next if claimed.zero?
43
+
44
+ Nuntius.event(event.transition_event.to_sym, event.transitionable)
43
45
  end
44
46
  end
45
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nuntius
4
- VERSION = "1.6.0"
4
+ VERSION = "1.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nuntius
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-10-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: apnotic
@@ -603,7 +602,6 @@ homepage: https://github.com/entdec/nuntius
603
602
  licenses:
604
603
  - MIT
605
604
  metadata: {}
606
- post_install_message:
607
605
  rdoc_options: []
608
606
  require_paths:
609
607
  - lib
@@ -618,8 +616,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
618
616
  - !ruby/object:Gem::Version
619
617
  version: '0'
620
618
  requirements: []
621
- rubygems_version: 3.4.10
622
- signing_key:
619
+ rubygems_version: 3.6.9
623
620
  specification_version: 4
624
621
  summary: Easily send emails, sms messages, teams & slack messages, and push notifications
625
622
  from your Rails app.