avo 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/avo/app/fields/belongs_to.rb +12 -1
- data/lib/avo/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: 9cab03834ddaad490fcd3f0eb64f9ac2006dacb235c2ffb34a451139da31444a
|
4
|
+
data.tar.gz: 20c9770b7b259b0207857e4b70450b73748c5d30b7dd405662b720e5f97499ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e024dbbb67133f849c0b45b65694ba6322bf8e07d5ae399280e9e233b54bf26ee954aaabf8eebdfd81e33db79b007ce78a73be5fc99e5fb3b5089b4a75121d81
|
7
|
+
data.tar.gz: 1d52cf19ca6a8a831222fd36762862de3e88f8f02c4469eaa19e98844da6f707677120e0f92d13bb47caed37fa3e7cf3f24b6f7f10a049805cbe222a3653fb42
|
data/Gemfile.lock
CHANGED
@@ -22,7 +22,8 @@ module Avo
|
|
22
22
|
fields[:searchable] = @searchable
|
23
23
|
fields[:is_relation] = true
|
24
24
|
fields[:database_id] = foreign_key model
|
25
|
-
|
25
|
+
|
26
|
+
target_resource = get_target_resource model
|
26
27
|
|
27
28
|
relation_model = model.public_send(@relation_method)
|
28
29
|
|
@@ -61,6 +62,16 @@ module Avo
|
|
61
62
|
model.class.reflections[@relation_method].foreign_key
|
62
63
|
end
|
63
64
|
end
|
65
|
+
|
66
|
+
def get_target_resource(model)
|
67
|
+
if model._reflections[id.to_s].klass.present?
|
68
|
+
App.get_resource_by_model_name model._reflections[id.to_s].klass.to_s
|
69
|
+
elsif model._reflections[id.to_s].options[:class_name].present?
|
70
|
+
App.get_resource_by_model_name model._reflections[id.to_s].options[:class_name]
|
71
|
+
else
|
72
|
+
App.get_resource_by_name class_name.to_s
|
73
|
+
end
|
74
|
+
end
|
64
75
|
end
|
65
76
|
end
|
66
77
|
end
|
data/lib/avo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-12-
|
12
|
+
date: 2020-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|