forest_admin_datasource_toolkit 1.0.0.pre.beta.36 → 1.0.0.pre.beta.38
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: 5ee068a893d25b8edcf81eab4e17c7490b449903baae1f46ebc60450f43c686d
|
4
|
+
data.tar.gz: f96d2fff248d893b76dac2d2448b00573f1182653c231f02b34de5aaedc2c4a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d916432097e3ec732b5e570f73a93a5249672e16265b59de659af701179561a3ddd8801afb1d084b55a2956b633c5d777bd10389ac8cb3d85d64f5bdec4ab52
|
7
|
+
data.tar.gz: 258a12b0a8952c9008fe8ff8da50ca9d74c91ddc86dc500fde1023a4424398175ca733b808becc632944e93b1de0cadde3a484720b7300859217a4135b100a16
|
@@ -6,7 +6,8 @@ module ForestAdminDatasourceToolkit
|
|
6
6
|
module Query
|
7
7
|
class Aggregation
|
8
8
|
include ForestAdminDatasourceToolkit::Exceptions
|
9
|
-
attr_reader :operation
|
9
|
+
attr_reader :operation
|
10
|
+
attr_accessor :groups, :field
|
10
11
|
|
11
12
|
def initialize(operation:, field: nil, groups: [])
|
12
13
|
validate(operation)
|
@@ -32,12 +33,12 @@ module ForestAdminDatasourceToolkit
|
|
32
33
|
Projection.new(aggregate_fields)
|
33
34
|
end
|
34
35
|
|
35
|
-
def replace_fields
|
36
|
+
def replace_fields
|
36
37
|
result = clone
|
37
|
-
result.field =
|
38
|
+
result.field = yield(result.field) if result.field
|
38
39
|
result.groups = result.groups.map do |group|
|
39
40
|
{
|
40
|
-
field:
|
41
|
+
field: yield(group[:field]),
|
41
42
|
operation: group[:operation] || nil
|
42
43
|
}
|
43
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_admin_datasource_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.38
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthieu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-03-
|
12
|
+
date: 2024-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|