active_propagation 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/active_propagation/class_extensions.rb +6 -1
- data/lib/active_propagation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74bc55ff758a716c017f4d37657ef0983c2bc9cd
|
4
|
+
data.tar.gz: 629e2024937b34b203bf0b2907c4d5d897648336
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9635a329f64052be13c20407998c2e0262422b0c813f52d11e602ddf5f64e7aa4c689187e232dfb2b7acabb344047e7e163cabb89e515dd0d171f5f8de11badc
|
7
|
+
data.tar.gz: 0272bd1219cc930aad72de105f25c05706f5037b8dc013112cab427734578f947274f399f02df6ae0ab6d04b06ed6413642b17445307d40f7c5fd18611e84b9e
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module ActivePropagation::ClassExtensions
|
2
2
|
def propagates_changes_to(association, only: [], async: false, nested_async: false, on: [:update, :destroy])
|
3
|
-
|
3
|
+
props = if class_variable_defined?(:@@propagations)
|
4
|
+
self.class_variable_get(:@@propagations) || {}
|
5
|
+
else
|
6
|
+
{}
|
7
|
+
end
|
8
|
+
self.class_variable_set(:@@propagations, props)
|
4
9
|
after_commit(:_run_active_propagation, on: on) unless _commit_callbacks.map(&:filter).include?(:_run_active_propagation)
|
5
10
|
self.class_variable_get(:@@propagations)[association] = {only: only, async: async, nested_async: nested_async}
|
6
11
|
end
|