effective_resources 2.19.11 → 2.19.12
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: 1be94e8ced0d5bd8c7e28d738435ca83614afe8caa6b7360fd760ec6a14b217c
|
4
|
+
data.tar.gz: 51c5577ee73d2c4206929d020f32ec29ac0488a50f125a264522a267610ba3b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e63dac719bd2e57f8d05c5c83d9c1c4ba7170e956097c6d843e65d10bfb1e9e44613bc5b40407439e68dd9c288f5a6ea7c31d86e103251993d0de3d6b669e721
|
7
|
+
data.tar.gz: 00f602d5582cf3e6d3cb1313bce80912a5937412ea513683b94e979b8561f5256433875d4d0838f5a7060257c3e8d90cc56fe143a6d5f639bc9e295a4de5e5a7
|
@@ -83,7 +83,7 @@ module Effective
|
|
83
83
|
date = if digits.first.length == 4 # 2017-01-10
|
84
84
|
(Time.zone.local(*digits) rescue nil)
|
85
85
|
else # 01/10/2016
|
86
|
-
year = digits.find { |d| d.length == 4}
|
86
|
+
year = digits.find { |d| d.length == 4 }
|
87
87
|
digits = [year] + (digits - [year])
|
88
88
|
(Time.zone.local(*digits) rescue nil)
|
89
89
|
end
|
@@ -299,7 +299,7 @@ module Effective
|
|
299
299
|
.where(ActiveStorage::Blob.arel_table[:filename].matches("%#{term}%"))
|
300
300
|
|
301
301
|
when :date, :datetime
|
302
|
-
if value.kind_of?(String)
|
302
|
+
if value.kind_of?(String) && term.respond_to?(:strftime)
|
303
303
|
end_at = (
|
304
304
|
case (value.to_s.scan(/(\d+)/).flatten).length
|
305
305
|
when 1 ; term.end_of_year # Year
|
@@ -323,8 +323,9 @@ module Effective
|
|
323
323
|
else
|
324
324
|
relation.where("#{sql_column} >= ? AND #{sql_column} <= ?", value.beginning_of_day, value.end_of_day)
|
325
325
|
end
|
326
|
+
elsif term.respond_to?(:strftime) == false && operation.to_s.include?('days_ago') == false
|
327
|
+
relation.none # It's an invalid entered date
|
326
328
|
end
|
327
|
-
|
328
329
|
when :effective_obfuscation
|
329
330
|
term = Attribute.new(as, klass: (associated(name).try(:klass) || klass)).parse(value, name: name)
|
330
331
|
relation.where(attribute.eq((value == term ? 0 : term)))
|
@@ -338,9 +339,13 @@ module Effective
|
|
338
339
|
relation.with_role(term)
|
339
340
|
|
340
341
|
when :time
|
341
|
-
|
342
|
-
|
343
|
-
|
342
|
+
if term.respond_to?(:strftime)
|
343
|
+
timed = relation.where("EXTRACT(hour from #{sql_column}) = ?", term.utc.hour)
|
344
|
+
timed = timed.where("EXTRACT(minute from #{sql_column}) = ?", term.utc.min) if term.min > 0
|
345
|
+
timed
|
346
|
+
else
|
347
|
+
relation.none # It's an invalid entered date
|
348
|
+
end
|
344
349
|
end
|
345
350
|
|
346
351
|
return searched if searched
|
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.12
|
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: 2024-03-
|
11
|
+
date: 2024-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|