forest_admin_datasource_active_record 1.0.0.pre.beta.23 → 1.0.0.pre.beta.25

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: 9c8b6b6053c938b270764e56adbc523ef326e4913b2261f8837d06312aa539cb
4
+ data.tar.gz: 949d55467f85f27e788dfc3038e1f5239f4b14edfb678d0b2a7f76a36df01daa
5
5
  SHA512:
6
- metadata.gz: ea8ce626732ebaad40be56a418e45367c7c51093ad19059b2c5f24ca9a0d36f8879b4a998b07f41e903c8e2491ba2d42d2cfd0998cae9a1bf24bc31c8b8fd762
7
- data.tar.gz: dbb0fac6f26019beb6802c0f254e6b919ad08e7e8bbb0026aaca500c22ca92f1bd0101ab2da33d0b37315f155c6ede874f6fb420ec8f684aa936bf53bfa64e85
6
+ metadata.gz: 5b3b8ade7aa53984e53e9131b05419da3b1a0d4bec098d90f66e93757def0d44d24b6940bb44d33d0d4375b02aac5634a89ce7d1769921eb2111e6bcea65eea1
7
+ data.tar.gz: eb353ea2cb00b94fc9c2c29b4847abbc613e217005c5238b591f6f14d3c29e9bd66fb695851d3c222204472b06434b0f8aa0d9b8282a385dd1ec3f58e3240289
@@ -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.25"
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.25
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-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord