forest_admin_datasource_active_record 1.27.0 → 1.27.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4998f8e8f5d68bb5a75ddce1d98bb649e3b2a851b7d2dceb1e6959b5907655f
|
|
4
|
+
data.tar.gz: 5e4cd0b1665363c28e499d8bef1e677fa82ad67bcfd9259c2192bcdb103a22a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18ee53cd6ecbc089bf1145ea9af333572ac5ab295f129c5870e3eaeb58c9c7012cb4adfd1da99c7aefa5b01b9a6a5decbf73ff53148fa5d89a9c0881b1a06e11
|
|
7
|
+
data.tar.gz: d59a44ebec438e354062b291955776aa75de60bf06046cadc47d2cc4ed459a78b108167284ec3bf67dba837d363bced763747c967eb6a1ca01ea396e73494965
|
|
@@ -83,6 +83,10 @@ module ForestAdminDatasourceActiveRecord
|
|
|
83
83
|
association.polymorphic?
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
def cascade_on_delete?(association)
|
|
87
|
+
%i[destroy destroy_async delete_all].include?(association.options[:dependent])
|
|
88
|
+
end
|
|
89
|
+
|
|
86
90
|
# rubocop:disable Metrics/BlockNesting
|
|
87
91
|
def fetch_associations
|
|
88
92
|
associations(@model, support_polymorphic_relations: @support_polymorphic_relations).each do |association|
|
|
@@ -118,7 +122,8 @@ module ForestAdminDatasourceActiveRecord
|
|
|
118
122
|
origin_key: association.foreign_key,
|
|
119
123
|
origin_key_target: association.association_primary_key,
|
|
120
124
|
origin_type_field: association.inverse_of.foreign_type,
|
|
121
|
-
origin_type_value: @model.name
|
|
125
|
+
origin_type_value: @model.name,
|
|
126
|
+
cascade_on_delete: cascade_on_delete?(association)
|
|
122
127
|
)
|
|
123
128
|
)
|
|
124
129
|
else
|
|
@@ -192,7 +197,8 @@ module ForestAdminDatasourceActiveRecord
|
|
|
192
197
|
origin_key: association.foreign_key,
|
|
193
198
|
origin_key_target: association.association_primary_key,
|
|
194
199
|
origin_type_field: association.inverse_of.foreign_type,
|
|
195
|
-
origin_type_value: @model.name
|
|
200
|
+
origin_type_value: @model.name,
|
|
201
|
+
cascade_on_delete: cascade_on_delete?(association)
|
|
196
202
|
)
|
|
197
203
|
)
|
|
198
204
|
else
|
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.27.
|
|
4
|
+
version: 1.27.2
|
|
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-
|
|
12
|
+
date: 2026-05-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activerecord
|