kithe 2.19.1 → 2.19.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: d3e9bf597fc10795766c9a58a90b4c33c8d027f25a2c4e7a223c2d260b822b61
4
- data.tar.gz: f0fbad2ac7db271aa923daf14ffae9cc1e8d965bd691170f279d22712d352b4c
3
+ metadata.gz: bf141e03fcc8d69bf947402896f692127a16ef063d783543f3cae16cd710c01f
4
+ data.tar.gz: 61e074411a3274f8ab6bb8ebf2aa378deb6dc243b89aa21d0a9702c53a548aed
5
5
  SHA512:
6
- metadata.gz: 3044a0c23fa38eb44e7d9ed442b562979d7570bf66e39950813cff5b497f5d434f91c74a777d96ab0e8e56bb7ca1b8d2abf78bb62401c04bba50b066eafbf891
7
- data.tar.gz: 8f6710d60185ca512bed116b4e653e2b7e2445c5cdd064b3efac51aa5c2c63997ec7042c609a6c721f8b5bfdcd47ad0c42831efe98129337bc807f691c87e1f3
6
+ metadata.gz: ff9634bd6bd8123010f9cc746225391ad6c3c07bff53b11ba852cf473633624121ec0b4a505fa6484e7e6eea994288f2bde2bcd94a398db8a753a0aad77be4c5
7
+ data.tar.gz: 5d212aa1b7260171dc649b5e5a928aafd5060b1a349c82c716291c2d7e0c520927ebb661835e1bfe3b49ac700fd5c834914bf0bb67c69ba75dbb5afd9aa23d6a
@@ -189,9 +189,23 @@ class Kithe::Model < ActiveRecord::Base
189
189
  # confusingly in this state, we need prepend FALSE to have this new callback be registered to go
190
190
  # FIRST. And this actually is correct and works whether or not run_after_transaction_callbacks_in_order_defined
191
191
  # Very confusing, we test thorougly.
192
- set_options_for_callbacks!(args, {prepend: false})
192
+ #
193
+ #
194
+ # We used to call ActiveRecord's private set_options_for_callbacks! to do this, but its
195
+ # signature changed incompatibly in a Rails 8.1 patch release. So we use only public
196
+ # API, plus the stable (but private) instance method transaction_include_any_action?
197
+ # to implement the `on:` option.
198
+ options = args.extract_options!.merge(prepend: false)
199
+
200
+ if options[:on]
201
+ fire_on = Array(options.delete(:on))
202
+ options[:if] = [
203
+ -> { transaction_include_any_action?(fire_on) },
204
+ *options[:if]
205
+ ]
206
+ end
193
207
 
194
- set_callback(:commit, :after, *args, &block)
208
+ set_callback(:commit, :after, *args, options, &block)
195
209
  end
196
210
 
197
211
  private
data/lib/kithe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kithe
2
- VERSION = '2.19.1'
2
+ VERSION = '2.19.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kithe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.1
4
+ version: 2.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind