hidden_hooks 1.1.0 → 1.1.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: e80baab48dbc8bc16a9dd82cbe6ba965d1b5076d0658404e7641e3c1e7818797
4
- data.tar.gz: 13b66da95b3dad6192d4ccab88b9f19f2c0cbb980b6e721b24df06e1cbea32ca
3
+ metadata.gz: 88532a44bde6fdd20a6bcd02505060ec0abffd7fe55e815c3dd82a80d0be8819
4
+ data.tar.gz: 118bd2af55f7472686deaf3c93f9008b8d3fd820dab2082d6f032103f4f72583
5
5
  SHA512:
6
- metadata.gz: 8b234e254887127321a42ff8ee96da7ba0f6a80179ca1bd1871a24d753143295746b1f99afcf57a01a4aa8f9fe987c3aefc791b655351e7f0aa6f69bdcbd0cd1
7
- data.tar.gz: 26eb29ecc3824a2628fafc7d21b687e37e66da4a3d2c16c439fcc9351b5c3324cb4aaf2a78b116b756e1324c1411bd21d00ddd780f89add7c0df9cf3a2bbe151
6
+ metadata.gz: 6c7b53ac8c04c1b6d02dbd6af42d7c7d6e6d93a60faea4c23ffcbf615e6744d3626678b01a4d8d4c4b53846263e188aedfcfb39ea9e22d36c61ddbdb4c98fa9e
7
+ data.tar.gz: c81d8c1c686af906141279a02067a90a131445506a6c83c9fd967bd582b7868a6da54e780f08c1cba3d44da920ae8796e2be2a8c2b47611792647eb92da39434
data/CHANGELOG.md CHANGED
@@ -8,6 +8,21 @@
8
8
  ### Bug fixes
9
9
  )-->
10
10
 
11
+ ## 1.1.2 2025-01-28
12
+
13
+ ### Bug fixes
14
+
15
+ - Fixed Active Record integration not setting callbacks for derived classes.
16
+ - Removed `after_*_commit` shortcut hooks.
17
+ - These aren't actually callbacks, but little more than wrappers for `after_commit` itself, so the method that gets called on the callback object is always `#after_commit`, causing some weird behaviors.
18
+
19
+ ## 1.1.1 2025-01-28
20
+
21
+ ### Bug fixes
22
+
23
+ - Removed `around_*` callbacks.
24
+ - The problem with `around_*` callbacks is that the callback needs to yield to the passed block otherwise the callback chain stops, so if there aren't hooks for a certain callback no one's yielding and the chain always stops.
25
+
11
26
  ## 1.1.0 2025-01-28
12
27
 
13
28
  ### New features
@@ -4,34 +4,30 @@ module HiddenHooks
4
4
  module ActiveRecord
5
5
  extend ActiveSupport::Concern
6
6
 
7
- included do
8
- [
9
- :after_commit,
10
- :after_create,
11
- :after_create_commit,
12
- :after_destroy,
13
- :after_destroy_commit,
14
- :after_find,
15
- :after_initialize,
16
- :after_rollback,
17
- :after_save,
18
- :after_save_commit,
19
- :after_touch,
20
- :after_update,
21
- :after_update_commit,
22
- :after_validation,
23
- :around_create,
24
- :around_destroy,
25
- :around_save,
26
- :around_update,
27
- :before_commit,
28
- :before_create,
29
- :before_destroy,
30
- :before_save,
31
- :before_update,
32
- :before_validation
33
- ].each do |callback|
34
- send callback, HiddenHooks[self], prepend: true
7
+ class_methods do
8
+ def inherited subclass
9
+ super
10
+
11
+ [
12
+ :after_commit,
13
+ :after_create,
14
+ :after_destroy,
15
+ :after_find,
16
+ :after_initialize,
17
+ :after_rollback,
18
+ :after_save,
19
+ :after_touch,
20
+ :after_update,
21
+ :after_validation,
22
+ :before_commit,
23
+ :before_create,
24
+ :before_destroy,
25
+ :before_save,
26
+ :before_update,
27
+ :before_validation
28
+ ].each do |callback|
29
+ subclass.send callback, HiddenHooks[subclass], prepend: true
30
+ end
35
31
  end
36
32
  end
37
33
  end
@@ -1,3 +1,3 @@
1
1
  module HiddenHooks
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hidden_hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moku S.r.l.