eventish 0.3.1 → 0.3.2

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
  SHA256:
3
- metadata.gz: 8f5572d1bca258f0f1c9bd4e09e3743f99bf3045c82013c9742e1b06cfb3c590
4
- data.tar.gz: abe5bdf2cbe1998404c21686ee97758681be8e038c0af03c67b7be1cbed2c8c5
3
+ metadata.gz: affdd6406fe05bcc51fa60a0bdd1e894c47412e8d8c347e2f8e4e8ed0d846757
4
+ data.tar.gz: 754e24d0338cb7eb4c6eb299371d2880b0b867a85fadb0b604ea3511a8e9ee32
5
5
  SHA512:
6
- metadata.gz: 885eb9228852f4d143a52ca2db3b622eead0bb9c57bc47fecb8ce29ce9694488973151a1bcaf07df2783192aa362dd3626c200ca36a39afc721a6f5c22cc6222
7
- data.tar.gz: e86ca0a3133a144c709a3a1cc76b2ba777d5995a8068ba202b6570bc4c31ab14e73fea390e3898825276bbc97651dfcdecb978af2266880f47219e810fc00d03
6
+ metadata.gz: 23e2bd4268d4c28a3691327e499552815fbe05d6ada3e17a887e812ec2666d4f65c8c78ac878d7ef0426403cd61760134a06f7c0d9a07da6c8e73fe440da9da0
7
+ data.tar.gz: 530d9dcd90223304e1606cbfe909ccf223d1353d1409a230807b29cf6258fa740228235975f0411484b99886ab961349a84ca73a3a432842090c7b95d69cf713
@@ -4,12 +4,12 @@ module Eventish
4
4
  module ActiveRecord
5
5
  module Callback
6
6
  # Init events
7
- def after_initialize_event
8
- before_validation -> { ::Eventish.publish(event, self) }
7
+ def after_initialize_event(event)
8
+ after_initialize -> { ::Eventish.publish(event, self) }
9
9
  end
10
10
 
11
- def after_find_event
12
- before_validation -> { ::Eventish.publish(event, self) }
11
+ def after_find_event(event)
12
+ after_find -> { ::Eventish.publish(event, self) }
13
13
  end
14
14
 
15
15
  # Validation events
@@ -27,7 +27,7 @@ module Eventish
27
27
  end
28
28
 
29
29
  def around_create_event(event)
30
- around_create -> { ::Eventish.publish(event, self) }
30
+ around_create ->(_object, block) { ::Eventish.publish(event, self, block: block) }
31
31
  end
32
32
 
33
33
  def after_create_event(event)
@@ -40,7 +40,7 @@ module Eventish
40
40
  end
41
41
 
42
42
  def around_update_event(event)
43
- around_update -> { ::Eventish.publish(event, self) }
43
+ around_update ->(_object, block) { ::Eventish.publish(event, self, block: block) }
44
44
  end
45
45
 
46
46
  def after_update_event(event)
@@ -53,7 +53,7 @@ module Eventish
53
53
  end
54
54
 
55
55
  def around_save_event(event)
56
- around_save -> { ::Eventish.publish(event, self) }
56
+ around_save ->(_object, block) { ::Eventish.publish(event, self, block: block) }
57
57
  end
58
58
 
59
59
  def after_save_event(event)
@@ -66,7 +66,7 @@ module Eventish
66
66
  end
67
67
 
68
68
  def around_destroy_event(event)
69
- around_destroy -> { ::Eventish.publish(event, self) }
69
+ around_destroy ->(_object, block) { ::Eventish.publish(event, self, block: block) }
70
70
  end
71
71
 
72
72
  def after_destroy_event(event)
@@ -78,10 +78,6 @@ module Eventish
78
78
  after_commit -> { ::Eventish.publish(event, self) }
79
79
  end
80
80
 
81
- def after_save_commit_event(event)
82
- after_save_commit -> { ::Eventish.publish(event, self) }
83
- end
84
-
85
81
  def after_create_commit_event(event)
86
82
  after_create_commit -> { ::Eventish.publish(event, self) }
87
83
  end
@@ -90,6 +86,10 @@ module Eventish
90
86
  after_update_commit -> { ::Eventish.publish(event, self) }
91
87
  end
92
88
 
89
+ def after_save_commit_event(event)
90
+ after_save_commit -> { ::Eventish.publish(event, self) }
91
+ end
92
+
93
93
  def after_destroy_commit_event(event)
94
94
  after_destroy_commit -> { ::Eventish.publish(event, self) }
95
95
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eventish # :nodoc:
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-19 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple and composable event library
14
14
  email: mat@blocknot.es