effective_resources 2.19.1 → 2.19.3
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: ca109163a4ec655cfcf78c96a0f2551c6609291b0e75741ffe6b5a617dd16c63
|
4
|
+
data.tar.gz: d8b7fecb587b577aba0f5d4cf230ecb52b7bb9a0eab8a8c8973aa5dd4ac5f553
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 702fe66414e7f6126e094d5ca593d94a8f83c15b5b796767da270d98adb7fcefa5830abb007ae84baa75dee7980725eca42397efe6e5efe03618409c0d920dd2
|
7
|
+
data.tar.gz: fcc9eafd30c1d3deb81524873577a146a19604c74463105b2647cc9f49dee7422a1dde16d198719697821951e3949eb3c9bc08f22e3283e7a4dcd9cd317609d6
|
@@ -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'
|
@@ -318,7 +318,11 @@ module Effective
|
|
318
318
|
relation.where("#{sql_column} >= ? AND #{sql_column} <= ?", term, end_at)
|
319
319
|
end
|
320
320
|
elsif value.respond_to?(:strftime) && operation == :eq
|
321
|
-
|
321
|
+
if as == :date
|
322
|
+
relation.where("#{sql_column} = ?", value)
|
323
|
+
else
|
324
|
+
relation.where("#{sql_column} >= ? AND #{sql_column} <= ?", value.beginning_of_day, value.end_of_day)
|
325
|
+
end
|
322
326
|
end
|
323
327
|
|
324
328
|
when :effective_obfuscation
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.19.
|
4
|
+
version: 2.19.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|