forest_admin_datasource_mongoid 1.28.2 → 1.29.0
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 +4 -4
- data/lib/forest_admin_datasource_mongoid/collection.rb +1 -1
- data/lib/forest_admin_datasource_mongoid/parser/validation.rb +1 -0
- data/lib/forest_admin_datasource_mongoid/utils/pipeline/group_generator.rb +2 -2
- data/lib/forest_admin_datasource_mongoid/utils/schema/fields_generator.rb +1 -1
- data/lib/forest_admin_datasource_mongoid/utils/schema/mongoid_schema.rb +1 -0
- data/lib/forest_admin_datasource_mongoid/utils/schema/relation_generator.rb +2 -2
- data/lib/forest_admin_datasource_mongoid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72c093382f024ea130a5a492b7278e8d6febebb412a606c77665c85ffebda5fa
|
|
4
|
+
data.tar.gz: 4b31f9b5be224ea0ca4cf11525801898e634e0ac709793ad4e41450cd1d76779
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6773e7c8ba83752ec11e55c19c96cf9bbab98b8d626a99621e7a9dde2572662d7d4c583258996494ec6de6f616cbc909fab49fb4895e0b136cb5d702bf7e3f0e
|
|
7
|
+
data.tar.gz: a963989610025b47c9a4e09a8c25d71f9449f2dc4615ee614a238fec819b1b7bbd4b8ba2b451d935dcbf8c771d340d28fc064e2bb02d4e3d4a44e900cc6e5b63
|
|
@@ -75,8 +75,8 @@ module ForestAdminDatasourceMongoid
|
|
|
75
75
|
def compute_groups_projection(groups)
|
|
76
76
|
return { '$literal' => {} } if groups.nil? || groups.empty?
|
|
77
77
|
|
|
78
|
-
groups.
|
|
79
|
-
|
|
78
|
+
groups.to_h do |group|
|
|
79
|
+
[group[:field], "$_id.#{group[:field]}"]
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
end
|
|
@@ -38,7 +38,7 @@ module ForestAdminDatasourceMongoid
|
|
|
38
38
|
|
|
39
39
|
return our_schema unless stack.length > 1
|
|
40
40
|
|
|
41
|
-
parent_prefix = stack[
|
|
41
|
+
parent_prefix = stack[-2][:prefix]
|
|
42
42
|
|
|
43
43
|
our_schema['_id'] = build_virtual_primary_key
|
|
44
44
|
parent_id = child_schema.fields['parent']['_id']
|
|
@@ -23,14 +23,14 @@ module ForestAdminDatasourceMongoid
|
|
|
23
23
|
# Create inverse of 'parent' relationship so that the relation name matches the actual name
|
|
24
24
|
# of the data which is stored in the database.
|
|
25
25
|
stack = collection.stack
|
|
26
|
-
prefix = stack[
|
|
26
|
+
prefix = stack[-1][:prefix]
|
|
27
27
|
is_array = MongoidSchema.from_model(collection.model).apply_stack(stack).is_array
|
|
28
28
|
|
|
29
29
|
type = is_array ? OneToManySchema : OneToOneSchema
|
|
30
30
|
inverse_name = escape(prefix)
|
|
31
31
|
|
|
32
32
|
if stack.length > 2
|
|
33
|
-
previous_length = stack[
|
|
33
|
+
previous_length = stack[-2][:prefix].length + 1
|
|
34
34
|
inverse_name = prefix[previous_length..]
|
|
35
35
|
end
|
|
36
36
|
else
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_datasource_mongoid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.29.0
|
|
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: 2026-05-
|
|
12
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mongoid
|