forest_admin_datasource_active_record 1.0.0.pre.beta.63 → 1.0.0.pre.beta.65
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b25b0145c04eb391ccd5b97e049bfac49d25ba202b18f6f5d1eb7e7b8f6c9ba
|
4
|
+
data.tar.gz: 89cf1bd05ba9ff06523ad8bf1d6d7fb8996bf788ce36811c8ce14586cf9dd4c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cec0e0f9e04502725144f51bd6d36170b63f7ecedd9ae745b42911c145c70d998c38416ebf71107b4d672d394654f44b3a20ad4f085905f73ba380d507bc01a4
|
7
|
+
data.tar.gz: b98fd31c5c9e4a7c0ba9ef0529152a56a4856133a6de7f2eaea6ece6c5985babff35e0e0583a9901c76a11a97fa47ce625cce38312d983419c385e988e903298
|
@@ -3,10 +3,11 @@ module ForestAdminDatasourceActiveRecord
|
|
3
3
|
module Relation
|
4
4
|
def associations(model, support_polymorphic_relations: false)
|
5
5
|
model.reflect_on_all_associations.select do |association|
|
6
|
+
is_valid_association = !get_class(association).nil? && !active_type?(get_class(association))
|
6
7
|
if support_polymorphic_relations
|
7
|
-
polymorphic?(association) ? true :
|
8
|
+
polymorphic?(association) ? true : is_valid_association
|
8
9
|
else
|
9
|
-
!polymorphic?(association) &&
|
10
|
+
!polymorphic?(association) && is_valid_association
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -16,6 +17,12 @@ module ForestAdminDatasourceActiveRecord
|
|
16
17
|
association.inverse_of&.polymorphic?
|
17
18
|
end
|
18
19
|
|
20
|
+
def get_class(association)
|
21
|
+
association.klass
|
22
|
+
rescue StandardError
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
19
26
|
# NOTICE: Ignores ActiveType::Object association during introspection and interactions.
|
20
27
|
# See the gem documentation: https://github.com/makandra/active_type
|
21
28
|
def active_type?(model)
|
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.
|
4
|
+
version: 1.0.0.pre.beta.65
|
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: 2024-08-
|
12
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|