hidden_hooks 1.1.1 → 1.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
  SHA256:
3
- metadata.gz: 8c3de95afe7b03bb8fc886bb721ef7af2db8d5c8284c7aa7c0d331e33f5b5751
4
- data.tar.gz: 02f901e311228c2db78c00c1d6f7cdc6e4ef4b6c56ca048c85c7976a2721170b
3
+ metadata.gz: 88532a44bde6fdd20a6bcd02505060ec0abffd7fe55e815c3dd82a80d0be8819
4
+ data.tar.gz: 118bd2af55f7472686deaf3c93f9008b8d3fd820dab2082d6f032103f4f72583
5
5
  SHA512:
6
- metadata.gz: 5d5c2d1346b269bd2f49a45c5cb419ad3cedd239d8f5c2c46fc6f5b95c7ccfe18d5c52f700c63e0a133f4ff81498afbca6917b1449a2e315fcef9dc1024a338f
7
- data.tar.gz: f5020d12589ece606c447d45bef122fde445d4136cce36e2120cd9ed23d835615c3cab2f47de1b50d1a9b1fbe2326f97cd08e47f3a47704a3be6f37ee7706fcb
6
+ metadata.gz: 6c7b53ac8c04c1b6d02dbd6af42d7c7d6e6d93a60faea4c23ffcbf615e6744d3626678b01a4d8d4c4b53846263e188aedfcfb39ea9e22d36c61ddbdb4c98fa9e
7
+ data.tar.gz: c81d8c1c686af906141279a02067a90a131445506a6c83c9fd967bd582b7868a6da54e780f08c1cba3d44da920ae8796e2be2a8c2b47611792647eb92da39434
data/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@
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
+
11
19
  ## 1.1.1 2025-01-28
12
20
 
13
21
  ### Bug fixes
@@ -4,30 +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
- :before_commit,
24
- :before_create,
25
- :before_destroy,
26
- :before_save,
27
- :before_update,
28
- :before_validation
29
- ].each do |callback|
30
- 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
31
31
  end
32
32
  end
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module HiddenHooks
2
- VERSION = '1.1.1'
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.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moku S.r.l.