delayed_after_commit 0.1.1 → 0.1.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
  SHA1:
3
- metadata.gz: 6d476b7b79252c2e4152a2bc4cb5b84ba78a0cde
4
- data.tar.gz: 16e0661a0db4e68113c681b57d371457068dfb5d
3
+ metadata.gz: ed5c2eaced3dc09bcd1478656122d4b108ed0f2e
4
+ data.tar.gz: ceb37a45202f51e11b36ded5eb7e193ca9951acf
5
5
  SHA512:
6
- metadata.gz: f92d9d6e6f977224ba24e7295b09eabae4f0726b6cf9817a3435aae03ed6a03d7e2cd51ca965871c752ed25d6bdc531e2b17d0bcf078ef75f0d3e4e49431a8bb
7
- data.tar.gz: 15fa192068b717dc42d2cf7431079593ccde2f65bf42973ab0bbe29917013b8e4c7338d7f094cb9be06979b5d111dfa3e13ae72d6c98f88d4ebe87736814bd39
6
+ metadata.gz: b4fa32073e9e9127762c3e4a5242b8f1152a76a1392696182b45e104adf7690716fd173dade874fcded27a93431cfcbf5cd8289767f7139d61a6dba9453a68c5
7
+ data.tar.gz: 2eab58dd585a70865cd61732845c740108f3552f58597826c5499172e5f379ff00370eec164b5bc3f359bc967c508722bb54d80067b0ccce69fb117c78d3d5ea
@@ -11,23 +11,23 @@ module DelayedAfterCommit
11
11
  obj.send(method)
12
12
  end
13
13
 
14
- def delayed_on_create(method)
15
- delayed_after_commit(method, on: :create)
14
+ def delayed_on_create(method, &block)
15
+ delayed_after_commit(method, on: :create, &block)
16
16
  end
17
17
 
18
- def delayed_on_update(method)
19
- delayed_after_commit(method, on: :update)
18
+ def delayed_on_update(method, &block)
19
+ delayed_after_commit(method, on: :update, &block)
20
20
  end
21
21
 
22
22
  protected
23
- def delayed_after_commit(method, on:)
23
+ def delayed_after_commit(method, on:, &block)
24
24
  # this creates a method that runs `enqueue_delayed_method`
25
25
  # it then adds that method to the after_commit callback
26
26
  delayed_method_name = "delayed_after_#{on}_#{method}"
27
27
  define_method(delayed_method_name) do |m = method|
28
28
  self.class.delay.enqueue_delayed_method(m, self.id)
29
29
  end
30
- self.after_commit(delayed_method_name.to_sym, on: on)
30
+ self.after_commit(delayed_method_name.to_sym, on: on, &block)
31
31
  end
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module DelayedAfterCommit
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_after_commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Rentzke