forest_admin_datasource_active_record 1.13.2 → 1.13.3
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: 7dcceae51ee5c4e32498c0fff0e2e72d1b50dabbe48481f341b6517a0d5509cf
|
|
4
|
+
data.tar.gz: 5382003e4fa3a25e7053f8075a48e9eca112dd430e32d7bd50949c3b50454746
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7737f65368f56c592c1f38e7196a3a9b1d32f325964beba45a4d16038589aa15e19dff5c5f4c9987691a838000527c8355c8b5009d5d52df906eca7d2253d29f
|
|
7
|
+
data.tar.gz: 183638680a962bb0a1ccbeac286dd8f40a99afa98240bc22f2b1d8d9f382f582e9504118483fc38ec22d2012dd6d04ecb235fbfa2bf45b0d4b1f2ec349b118df
|
|
@@ -132,8 +132,11 @@ module ForestAdminDatasourceActiveRecord
|
|
|
132
132
|
foreign_key_targets: foreign_collections
|
|
133
133
|
)
|
|
134
134
|
)
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
|
|
136
|
+
warn_missing_polymorphic_columns(association)
|
|
137
|
+
|
|
138
|
+
schema[:fields][association.foreign_key]&.is_read_only = true
|
|
139
|
+
schema[:fields][association.foreign_type]&.is_read_only = true
|
|
137
140
|
else
|
|
138
141
|
add_field(
|
|
139
142
|
association.name.to_s,
|
|
@@ -196,5 +199,21 @@ module ForestAdminDatasourceActiveRecord
|
|
|
196
199
|
end
|
|
197
200
|
end
|
|
198
201
|
end
|
|
202
|
+
|
|
203
|
+
def warn_missing_polymorphic_columns(association)
|
|
204
|
+
missing_columns = []
|
|
205
|
+
missing_columns << association.foreign_key unless schema[:fields][association.foreign_key]
|
|
206
|
+
missing_columns << association.foreign_type unless schema[:fields][association.foreign_type]
|
|
207
|
+
|
|
208
|
+
return unless missing_columns.any?
|
|
209
|
+
|
|
210
|
+
logger = ActiveSupport::Logger.new($stdout)
|
|
211
|
+
columns_list = missing_columns.join(', ')
|
|
212
|
+
logger.warn(
|
|
213
|
+
"[ForestAdmin] ⚠️ Missing columns for polymorphic association '#{association.name}' " \
|
|
214
|
+
"in model '#{@model.name}': #{columns_list}. " \
|
|
215
|
+
'This may indicate pending migrations. Run `rails db:migrate:status` to check.'
|
|
216
|
+
)
|
|
217
|
+
end
|
|
199
218
|
end
|
|
200
219
|
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.13.
|
|
4
|
+
version: 1.13.3
|
|
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: 2025-11-
|
|
12
|
+
date: 2025-11-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activerecord
|