effective_resources 2.19.1 → 2.19.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e037b88af5504219df4970853f4e40c64fb22b3da5d129ad1e7ce42f6b8e9206
|
4
|
+
data.tar.gz: 21d7142ac19a0b8b335a5ac49ed3133b2162993168e5df4a22932ba4fdbccbbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6d8de4f9cfd511c0d25d33fc0e3c2760d48d67a56299943bcaa13cb5fac1e46bf9c5936ff06322b78bc0624e74b375131f23cc126260e184424281eaf65bcc0
|
7
|
+
data.tar.gz: 64b813fcc0ba368030ae332c3e58d462ccd0a018faf7081b5cdd82974511450482c94006122087d56990d508235af2da8b5b0a7242a0ce21423090a1474ab6b6
|
@@ -84,13 +84,19 @@ module Effective
|
|
84
84
|
def resource_scope
|
85
85
|
relation = effective_resource.relation
|
86
86
|
|
87
|
+
# This was explicitly set in the controller using resource_scope -> dsl
|
88
|
+
return relation if respond_to?(:resource_scope_relation)
|
89
|
+
|
90
|
+
# Otherwise, apply .jit_preload or .deep automatically
|
91
|
+
|
87
92
|
# Apply jit_preloader if present
|
88
93
|
if defined?(JitPreloader) && EffectiveResources.use_jit_preloader && relation.respond_to?(:includes_values)
|
89
94
|
relation.includes_values = [] # Removes any previously defined .includes()
|
90
|
-
relation.jit_preload
|
91
|
-
else
|
92
|
-
(relation.try(:deep) || relation)
|
95
|
+
return relation.jit_preload
|
93
96
|
end
|
97
|
+
|
98
|
+
# Try .deep or return original relation
|
99
|
+
(relation.try(:deep) || relation)
|
94
100
|
end
|
95
101
|
|
96
102
|
def resource_name # 'thing'
|