forest_admin_datasource_active_record 1.0.0.pre.beta.23 → 1.0.0.pre.beta.24

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: 51b8d4407b45292ae0e56ff578709bec39e08d678e6b47a1fbc24d719f2f63f3
4
- data.tar.gz: d56d1f01095082675496cab77136c0ff076f1159d2f8399494d9ce168e361337
3
+ metadata.gz: e0e8066d5c92b8c29a1af80b8abf88f7f619eeb22c101a45aab964dd4b1c8d5c
4
+ data.tar.gz: bcdf8bbc3b7b45f0488317c56b9058b6becf7a1a93e7aa0f5609f7cbdf362ff0
5
5
  SHA512:
6
- metadata.gz: ea8ce626732ebaad40be56a418e45367c7c51093ad19059b2c5f24ca9a0d36f8879b4a998b07f41e903c8e2491ba2d42d2cfd0998cae9a1bf24bc31c8b8fd762
7
- data.tar.gz: dbb0fac6f26019beb6802c0f254e6b919ad08e7e8bbb0026aaca500c22ca92f1bd0101ab2da33d0b37315f155c6ede874f6fb420ec8f684aa936bf53bfa64e85
6
+ metadata.gz: 6369edf2a171a44f5ae77474531cbe2d7943b1d12253e423dfc5353e01daacfa22a3f5870d5cc732624329f81c814115056be130c3b2a694bd7f11eaf7449eee
7
+ data.tar.gz: 8a91c54e1aecc09faa1dfe38dae73fb40849d73093ad46c99d0b74ea47008ca28a2053147367917a8931fd57364b659caa3f553900f52ffd9aa2569638ca4a89
@@ -12,6 +12,7 @@ module ForestAdminDatasourceActiveRecord
12
12
  super(datasource, name)
13
13
  fetch_fields
14
14
  fetch_associations
15
+ enable_count
15
16
  end
16
17
 
17
18
  def list(_caller, filter, projection)
@@ -75,7 +75,7 @@ module ForestAdminDatasourceActiveRecord
75
75
  unless @projection.nil?
76
76
  @select += @projection.columns.map { |field| "#{@collection.model.table_name}.#{field}" }
77
77
  @projection.relations.each_key do |relation|
78
- relation_schema = @collection.fields[relation]
78
+ relation_schema = @collection.schema[:fields][relation]
79
79
  @select << if relation_schema.type == 'OneToOne'
80
80
  "#{@collection.model.table_name}.#{relation_schema.origin_key_target}"
81
81
  else
@@ -116,8 +116,8 @@ module ForestAdminDatasourceActiveRecord
116
116
  def format_field(field)
117
117
  if field.include?(':')
118
118
  relation_name, field = field.split(':')
119
- relation = @collection.fields[relation_name]
120
- table_name = @collection.datasource.collection(relation.foreign_collection).model.table_name
119
+ relation = @collection.schema[:fields][relation_name]
120
+ table_name = @collection.datasource.get_collection(relation.foreign_collection).model.table_name
121
121
  add_join_relation(relation, relation_name)
122
122
  return "#{table_name}.#{field}"
123
123
  end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceActiveRecord
2
- VERSION = "1.0.0-beta.23"
2
+ VERSION = "1.0.0-beta.24"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_datasource_active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.23
4
+ version: 1.0.0.pre.beta.24
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: 2023-12-13 00:00:00.000000000 Z
12
+ date: 2023-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord