active_propagation 0.2.7 → 0.2.8
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/Gemfile.lock +1 -1
- data/lib/active_propagation.rb +9 -10
- data/lib/active_propagation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 546b45d44944c308de7c49f242a763de3982a7a6
|
4
|
+
data.tar.gz: 552ef586326008e01556de50bc36bb6409793d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04a19e40126cf00016a218d698f08ef158346836a0c24b50f9befc1d7df9881e7fff8f5a0c626029449b84ff0d725b7281dae964cca6359c42c16932cc0ad560
|
7
|
+
data.tar.gz: 8909f0be111e1c96141d64cba2f2f538417aa9ca31649e87ee2b822aff35ffe82a0cf58abc70da97aee7590666af45ebdacc392b1b997eb54844d6eed46a427f
|
data/Gemfile.lock
CHANGED
data/lib/active_propagation.rb
CHANGED
@@ -13,7 +13,7 @@ module ActivePropagation
|
|
13
13
|
|
14
14
|
def run
|
15
15
|
assocs.each do |a|
|
16
|
-
yield a
|
16
|
+
yield a, assoc_klass
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -50,17 +50,16 @@ module ActivePropagation
|
|
50
50
|
class AsyncLoopDeletor
|
51
51
|
include PropagaterHelper
|
52
52
|
include Sidekiq::Worker
|
53
|
-
def perform(
|
54
|
-
|
55
|
-
klass.find(assoc_id).destroy
|
53
|
+
def perform(assoc_klass_str, assoc_id)
|
54
|
+
assoc_klass_str.constantize.find(assoc_id).destroy
|
56
55
|
end
|
57
56
|
end
|
58
57
|
|
59
58
|
class AsyncDeletor < AbstractPropagaterWorker
|
60
59
|
def perform(klass_str, model_id, assoc, only)
|
61
60
|
klass = klass_str.constantize
|
62
|
-
Propagater.new(klass, assoc, model_id).run do |a|
|
63
|
-
AsyncLoopDeletor.perform_async(
|
61
|
+
Propagater.new(klass, assoc, model_id).run do |a, assoc_klass|
|
62
|
+
AsyncLoopDeletor.perform_async(assoc_klass.to_s, a.id)
|
64
63
|
end
|
65
64
|
end
|
66
65
|
end
|
@@ -68,18 +67,18 @@ module ActivePropagation
|
|
68
67
|
class AsyncLoopUpdater
|
69
68
|
include Sidekiq::Worker
|
70
69
|
include PropagaterHelper
|
71
|
-
def perform(klass_str, model_id, assoc_id, only)
|
70
|
+
def perform(klass_str, model_id, assoc_id, only, assoc_klass_str)
|
72
71
|
klass = klass_str.constantize
|
73
72
|
model = klass.find(model_id)
|
74
|
-
|
73
|
+
assoc_klass_str.constantize.find(assoc_id).update(propagated_attributes(model, only))
|
75
74
|
end
|
76
75
|
end
|
77
76
|
|
78
77
|
class AsyncUpdater < AbstractPropagaterWorker
|
79
|
-
def perform(klass_str, model_id, assoc, only)
|
78
|
+
def perform(klass_str, model_id, assoc, only, assoc_klass_str)
|
80
79
|
klass = klass_str.constantize
|
81
80
|
Propagater.new(klass, assoc, model_id).run do |a|
|
82
|
-
AsyncLoopUpdater.perform_async(klass.to_s, model_id, a.id, only)
|
81
|
+
AsyncLoopUpdater.perform_async(klass.to_s, model_id, a.id, only, assoc_klass_str.to_s)
|
83
82
|
end
|
84
83
|
end
|
85
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_propagation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshiki Schmitz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|