delayed_after_commit 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbf215af4da0696ce77b3a66ea46ffdb82894cf5
4
- data.tar.gz: 497c34145e4e8d05ca9f76181a0679468f4f1773
3
+ metadata.gz: 6d476b7b79252c2e4152a2bc4cb5b84ba78a0cde
4
+ data.tar.gz: 16e0661a0db4e68113c681b57d371457068dfb5d
5
5
  SHA512:
6
- metadata.gz: 3a84762a172d295a59928ea9be8d1f43efac381531eaf3483e14eb52f00650c44ad2f3db5451c6bf2864e23d688c51d89b8b30e6471867d2c8d13514b05f8054
7
- data.tar.gz: 3a377597e9becc61d396680df1df0ba42f95a6dd76234d732e2462bc1846b4f7f6a2ea54a27ca983fb3079f45ac43880b1f6e5d2b6221c4e7460301f117a7700
6
+ metadata.gz: f92d9d6e6f977224ba24e7295b09eabae4f0726b6cf9817a3435aae03ed6a03d7e2cd51ca965871c752ed25d6bdc531e2b17d0bcf078ef75f0d3e4e49431a8bb
7
+ data.tar.gz: 15fa192068b717dc42d2cf7431079593ccde2f65bf42973ab0bbe29917013b8e4c7338d7f094cb9be06979b5d111dfa3e13ae72d6c98f88d4ebe87736814bd39
data/README.md CHANGED
@@ -30,8 +30,16 @@ Or install it yourself as:
30
30
 
31
31
  class User < ActiveRecord::Base
32
32
  include DelayedAfterCommit
33
- delayed_on_update :increment_number_of_updates
34
- delayed_on_create :calculate_number_of_letters_in_name
33
+ delayed_on_update :hi_ive_been_updated
34
+ delayed_on_create :hi_im_new_around_here
35
+
36
+ def hi_ive_been_updated
37
+ puts "Hi - I've been updated"
38
+ end
39
+
40
+ def hi_ive_been_updated
41
+ puts "Hi - I've just been created"
42
+ end
35
43
  end
36
44
 
37
45
  ```
@@ -20,10 +20,9 @@ module DelayedAfterCommit
20
20
  end
21
21
 
22
22
  protected
23
- def delayed_after_commit(method, on: nil)
23
+ def delayed_after_commit(method, on:)
24
24
  # this creates a method that runs `enqueue_delayed_method`
25
25
  # it then adds that method to the after_commit callback
26
- on ||= :update
27
26
  delayed_method_name = "delayed_after_#{on}_#{method}"
28
27
  define_method(delayed_method_name) do |m = method|
29
28
  self.class.delay.enqueue_delayed_method(m, self.id)
@@ -1,3 +1,3 @@
1
1
  module DelayedAfterCommit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Rentzke