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 +4 -4
- data/lib/active_propagation.rb +7 -3
- 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: abbedf87f185422451484de55a3abad6bfb21bcc
|
|
4
|
+
data.tar.gz: 44387722101e6c575fbab0d401fff561a04d7b54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92d11315a31c94b06992919ff191b67073749e40030c8d1bad4ac4fcf3097949ee3968ca13f3cf237bc0f642d8d75a4fc2f5eab6c65648330e5c7b77af469c7b
|
|
7
|
+
data.tar.gz: 5d6070b43c909eb4369b24d03f5edabb06cef4906a8f1ae944a4faabd4aeb071be0d125f6a5ab0b8cd0e2bb4ed26c28fd337b8d9e40aa11ea69c82aa9643a5cc
|
data/lib/active_propagation.rb
CHANGED
|
@@ -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
|
-
|
|
27
|
+
reflection.foreign_key
|
|
26
28
|
end
|
|
27
29
|
|
|
28
30
|
def assoc_klass
|
|
29
|
-
|
|
31
|
+
reflection.class_name.constantize
|
|
30
32
|
end
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
def reflection
|
|
35
|
+
klass.reflections.with_indifferent_access[association]
|
|
36
|
+
end
|
|
33
37
|
|
|
34
38
|
attr_reader :klass, :association, :id
|
|
35
39
|
end
|