forest_admin_agent 1.50.0 → 1.50.2

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: 7eb9d1c630cc4518617a78737f22abe89cdfbfe65e9c628df8484a7220731507
4
- data.tar.gz: b4035538499212ac019d1063e44582ef7a7562cd4645f1f4c8bac2930398cd79
3
+ metadata.gz: ac90d80d2b66c4cb4c5d10815a415905073aa1ad04f1685535b3fda824256036
4
+ data.tar.gz: 707b71165b818dd56884b60b805f0c118773c694f3743325041777603de58976
5
5
  SHA512:
6
- metadata.gz: 1a3d03aa089e7188ad1b248b9f26a495e3db2d8111f0fe52d0b29e8ea65414bd158f143a09eff57b4337224b80aee82a8d3080d2ee67bc4e416a96a320edc04b
7
- data.tar.gz: ac1689d5a265f37f7c3da16330a0aaa5471fd13fbdf839905ad14430eb73117ac7524cc42bab980ece067b177c007de149f3787ee77bc907c11a18810a7a8f48
6
+ metadata.gz: c1232bb67bb38f8cf5c69ca8c677a7b936984235e5f2dc2ea2453c8f4dbb19626ea75af3ecdfa5e0c0b5ec87b990001f7aaa77b31a190920a78989ee546db48d
7
+ data.tar.gz: b166cd50567c53de57746cd9bd26f93efc1a41915b6ee68808ae627d2676cc908debc2f2fe2cd5ce514de2cc58888ee12e68f6bd40d2520a4df9d9c46df9f99d
@@ -145,6 +145,8 @@ module ForestAdminAgent
145
145
  values = {}
146
146
  rows.each { |row| values[row['group'][group_by_field_name]] = row['value'] }
147
147
  dates = values.keys.sort
148
+ return LineChart.new([]).serialize if dates.empty?
149
+
148
150
  current = dates[0]
149
151
  last = dates.last
150
152
  result = []
@@ -153,7 +153,7 @@ module ForestAdminAgent
153
153
 
154
154
  result = context.child_collection.aggregate(context.caller, old_fk_owner_filter,
155
155
  Aggregation.new(operation: 'Count'), 1)
156
- return unless !(result[0]['value']).nil? && (result[0]['value']).positive?
156
+ return unless result.first&.[]('value')&.positive?
157
157
 
158
158
  # Avoids updating records to null if it's not authorized by the ORM
159
159
  # and if there is no record to update (the filter returns no record)
@@ -206,7 +206,7 @@ module ForestAdminAgent
206
206
 
207
207
  result = context.child_collection.aggregate(context.caller, old_fk_owner_filter,
208
208
  Aggregation.new(operation: 'Count'), 1)
209
- return unless !(result[0]['value']).nil? && (result[0]['value']).positive?
209
+ return unless result.first&.[]('value')&.positive?
210
210
 
211
211
  # Avoids updating records to null if it's not authorized by the ORM
212
212
  # and if there is no record to update (the filter returns no record)
@@ -6,7 +6,7 @@ module ForestAdminAgent
6
6
  module Schema
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
- LIANA_VERSION = "1.50.0"
9
+ LIANA_VERSION = "1.50.2"
10
10
 
11
11
  def self.generate(datasource)
12
12
  datasource.collections
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.50.0"
2
+ VERSION = "1.50.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.50.0
4
+ version: 1.50.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu