associationist 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86629357a2894bef36a64e5b1509b7e9a15cef85
|
4
|
+
data.tar.gz: 943b4fe8c567c4c92d638efe961b8f07146843b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a4b7c799474d1aff7511a8f77f4993b1f7cc70d59a0f83974cef653ae775bdc6636580046ef1ac8a912d90f3524a5ebcc0a26b04557999617354d6240ad5285
|
7
|
+
data.tar.gz: ad01edca0cd23d63c53165f6fccb5bf22ee41aa16c1e3abbf38e4fdafaae50a629749e36f1c9a56d2fdb41063a611594a3d6531c26dd966076113f1711029f33
|
@@ -2,7 +2,7 @@ module Associationist
|
|
2
2
|
module Associations
|
3
3
|
class CollectionAssociation < ::ActiveRecord::Associations::HasManyAssociation
|
4
4
|
def association_scope
|
5
|
-
reflection.config.scope_proc.call(owner)
|
5
|
+
@_association_scope ||= reflection.config.scope_proc.call(owner)
|
6
6
|
end
|
7
7
|
|
8
8
|
def find_target?
|
@@ -2,11 +2,11 @@ module Associationist
|
|
2
2
|
module Associations
|
3
3
|
class SingularAssociation < ::ActiveRecord::Associations::SingularAssociation
|
4
4
|
def association_scope
|
5
|
-
if reflection.config.scope_proc
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
@_association_scope ||= if reflection.config.scope_proc
|
6
|
+
reflection.config.scope_proc.call(owner)
|
7
|
+
else
|
8
|
+
raise NotImplementedError
|
9
|
+
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def find_target
|