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: d3d8c5b1c1274bd495e86cfae6e4f2c0b8ee1a4cc4655f8e7472f61b3fc7fc48
4
- data.tar.gz: afd39e3f506770138dc50cf4e361b4164b4b9014d678e3ba22c5a57e90ba86d6
3
+ metadata.gz: 5ee068a893d25b8edcf81eab4e17c7490b449903baae1f46ebc60450f43c686d
4
+ data.tar.gz: f96d2fff248d893b76dac2d2448b00573f1182653c231f02b34de5aaedc2c4a7
5
5
  SHA512:
6
- metadata.gz: 387ac362e95d5bd809fe2790e20c01c4bbec05d41266579bdb7a84863d825d7d9b25116ae4a44dde377f2779034623561a684f14679c74fa96d9523aaf32ed18
7
- data.tar.gz: dba0eab2b216fcd3113e991c08a82dbfe18b0dcb3476a4f61f23ba3ebad2955482ed2fbbb604da5cf3744b6cadce6e550245c2b8e982f7871bf708401046d264
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, :field, :groups
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(handler)
36
+ def replace_fields
36
37
  result = clone
37
- result.field = handler.call(result.field) if result.field
38
+ result.field = yield(result.field) if result.field
38
39
  result.groups = result.groups.map do |group|
39
40
  {
40
- field: handler.call(group[:field]),
41
+ field: yield(group[:field]),
41
42
  operation: group[:operation] || nil
42
43
  }
43
44
  end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceToolkit
2
- VERSION = "1.0.0-beta.36"
2
+ VERSION = "1.0.0-beta.38"
3
3
  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.36
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-18 00:00:00.000000000 Z
12
+ date: 2024-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport