active_propagation 0.2.2 → 0.2.4

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: 74bc55ff758a716c017f4d37657ef0983c2bc9cd
4
- data.tar.gz: 629e2024937b34b203bf0b2907c4d5d897648336
3
+ metadata.gz: abbedf87f185422451484de55a3abad6bfb21bcc
4
+ data.tar.gz: 44387722101e6c575fbab0d401fff561a04d7b54
5
5
  SHA512:
6
- metadata.gz: 9635a329f64052be13c20407998c2e0262422b0c813f52d11e602ddf5f64e7aa4c689187e232dfb2b7acabb344047e7e163cabb89e515dd0d171f5f8de11badc
7
- data.tar.gz: 0272bd1219cc930aad72de105f25c05706f5037b8dc013112cab427734578f947274f399f02df6ae0ab6d04b06ed6413642b17445307d40f7c5fd18611e84b9e
6
+ metadata.gz: 92d11315a31c94b06992919ff191b67073749e40030c8d1bad4ac4fcf3097949ee3968ca13f3cf237bc0f642d8d75a4fc2f5eab6c65648330e5c7b77af469c7b
7
+ data.tar.gz: 5d6070b43c909eb4369b24d03f5edabb06cef4906a8f1ae944a4faabd4aeb071be0d125f6a5ab0b8cd0e2bb4ed26c28fd337b8d9e40aa11ea69c82aa9643a5cc
@@ -17,19 +17,23 @@ module ActivePropagation
17
17
  end
18
18
  end
19
19
 
20
+ private
21
+
20
22
  def assocs
21
23
  assoc_klass.where(foreign_key => id)
22
24
  end
23
25
 
24
26
  def foreign_key
25
- klass.reflections[association.to_s].foreign_key
27
+ reflection.foreign_key
26
28
  end
27
29
 
28
30
  def assoc_klass
29
- klass.reflections[association.to_s].class_name.constantize
31
+ reflection.class_name.constantize
30
32
  end
31
33
 
32
- private
34
+ def reflection
35
+ klass.reflections.with_indifferent_access[association]
36
+ end
33
37
 
34
38
  attr_reader :klass, :association, :id
35
39
  end
@@ -1,3 +1,3 @@
1
1
  module ActivePropagation
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_propagation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshiki Schmitz