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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79d774d7dacfb77da2804df440ed5998e69f66ab
4
- data.tar.gz: 49bd82afebce0fb782ef4ea589d01b5ff5471f5d
3
+ metadata.gz: 546b45d44944c308de7c49f242a763de3982a7a6
4
+ data.tar.gz: 552ef586326008e01556de50bc36bb6409793d5c
5
5
  SHA512:
6
- metadata.gz: 000adc4aa24ea939f3be6334450a67c28ad9c6a7bee40c0fca5398148d3b4cfe825a4c00baec9dd32a0d1bc76cc537b3af260829c5ab3d191f774a4eb9b33f4b
7
- data.tar.gz: 19acdd08c2d216dd27e27e2be241a9be39d0bf08402dad61d3c89e038927252d9fb1814e6cc527ca20b79b9f464b6959864757e49a50b02b3174d8c8946958f6
6
+ metadata.gz: 04a19e40126cf00016a218d698f08ef158346836a0c24b50f9befc1d7df9881e7fff8f5a0c626029449b84ff0d725b7281dae964cca6359c42c16932cc0ad560
7
+ data.tar.gz: 8909f0be111e1c96141d64cba2f2f538417aa9ca31649e87ee2b822aff35ffe82a0cf58abc70da97aee7590666af45ebdacc392b1b997eb54844d6eed46a427f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_propagation (0.2.6)
4
+ active_propagation (0.2.7)
5
5
  activerecord (~> 4.0)
6
6
  activesupport (~> 4.0)
7
7
  sidekiq
@@ -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(klass_str, assoc_id)
54
- klass = klass_str.constantize
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(klass.to_s, a.id)
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
- klass.find(assoc_id).update(propagated_attributes(model, only))
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
@@ -1,3 +1,3 @@
1
1
  module ActivePropagation
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  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.7
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-13 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler