forest_liana 9.20.4 → 9.20.5
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a276e10f6f55ce7c4b4aedf82f58847599273e82fa86b001d02573ff56d70a59
|
|
4
|
+
data.tar.gz: a8527baf9d848dbf81e3d989cd473718c859df54339df0e5172e795260b3410b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6516197269ef7e03df7e4c75f1c474147b9332b82945a8f688791f5e739e204dc5b443b572812f8394a93e15a7cad73e43d853056116a375c568f56db9dd99bd
|
|
7
|
+
data.tar.gz: f1966c816f63eba307e6e318d7ada4f7e3bf9280360695d6eb95859e7122cfbf8fbc2d34e2a68a5ab5489203c44e4aece02fb4759c6931fd3ed9d3e589530d0f
|
|
@@ -33,7 +33,9 @@ module ForestLiana
|
|
|
33
33
|
key = @resource.defined_enums[@params[:groupByFieldName]].invert[key]
|
|
34
34
|
elsif @resource.columns_hash[@params[:groupByFieldName]] &&
|
|
35
35
|
@resource.columns_hash[@params[:groupByFieldName]].type == :datetime
|
|
36
|
-
|
|
36
|
+
# NOTICE: A nil datetime group key would raise NoMethodError on
|
|
37
|
+
# `nil + timezone_offset.hours`; label it explicitly.
|
|
38
|
+
key = key.present? ? (key + timezone_offset.hours).strftime('%d/%m/%Y %T') : 'No value'
|
|
37
39
|
end
|
|
38
40
|
|
|
39
41
|
{ key: key, value: value }
|
data/lib/forest_liana/version.rb
CHANGED
|
@@ -44,6 +44,33 @@ module ForestLiana
|
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
describe 'grouping by a nullable datetime field with a null value' do
|
|
48
|
+
let(:scopes) { {'scopes' => {}, 'team' => {'id' => '1', 'name' => 'Operations'}} }
|
|
49
|
+
let(:model) { Tree }
|
|
50
|
+
let(:collection) { 'trees' }
|
|
51
|
+
let(:params) {
|
|
52
|
+
{
|
|
53
|
+
type: 'Pie',
|
|
54
|
+
sourceCollectionName: collection,
|
|
55
|
+
timezone: 'Europe/Paris',
|
|
56
|
+
aggregator: 'Count',
|
|
57
|
+
groupByFieldName: 'created_at'
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
subject { PieStatGetter.new(model, params, user) }
|
|
62
|
+
|
|
63
|
+
before do
|
|
64
|
+
tree = Tree.create!(name: 'No date tree', age: 1)
|
|
65
|
+
tree.update_columns(created_at: nil)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it 'labels the null bucket "No value" instead of raising on nil + offset' do
|
|
69
|
+
expect { subject.perform }.not_to raise_error
|
|
70
|
+
expect(subject.record.value.map { |entry| entry[:key] }).to include('No value')
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
47
74
|
describe 'with valid aggregate function' do
|
|
48
75
|
let(:model) { Tree }
|
|
49
76
|
let(:collection) { 'trees' }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_liana
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 9.20.
|
|
4
|
+
version: 9.20.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sandro Munda
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-08-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|