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 +4 -4
- data/app/models/kithe/model.rb +16 -2
- data/lib/kithe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf141e03fcc8d69bf947402896f692127a16ef063d783543f3cae16cd710c01f
|
|
4
|
+
data.tar.gz: 61e074411a3274f8ab6bb8ebf2aa378deb6dc243b89aa21d0a9702c53a548aed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff9634bd6bd8123010f9cc746225391ad6c3c07bff53b11ba852cf473633624121ec0b4a505fa6484e7e6eea994288f2bde2bcd94a398db8a753a0aad77be4c5
|
|
7
|
+
data.tar.gz: 5d212aa1b7260171dc649b5e5a928aafd5060b1a349c82c716291c2d7e0c520927ebb661835e1bfe3b49ac700fd5c834914bf0bb67c69ba75dbb5afd9aa23d6a
|
data/app/models/kithe/model.rb
CHANGED
|
@@ -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
|
-
|
|
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