avo 2.33.3.pre.2 → 2.34.0
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/fields/belongs_to_field.rb +7 -1
- data/lib/avo/version.rb +1 -1
- metadata +4 -5
- data/config/master.key +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dce48ff1282bab4437a07c321a0099ce1755e92c96d0b82a29e2d91577b33da4
|
4
|
+
data.tar.gz: de4b93b760c5177e9631c51957eda7915f817b3ab60ed8a24c8fe9be739e19f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50614474a512b8b8f22eb0a10c2c225fbe13b122bd7719109a842af0e82beccbe7d3f1977f966cd5a1316f31a08d894467afb1cf9dbd9e99745b7bf21560a281
|
7
|
+
data.tar.gz: 7331125c451330a2926e980b51e8dba2e6b9072b97965aa40a1a2b7afb6367c1822185088749e55c011e0666ce4d50c95a111b51e5f1ddf175e95c8caaca5a7a
|
data/Gemfile.lock
CHANGED
@@ -199,7 +199,7 @@ module Avo
|
|
199
199
|
def fill_field(model, key, value, params)
|
200
200
|
return model unless model.methods.include? key.to_sym
|
201
201
|
|
202
|
-
valid_model_class =
|
202
|
+
valid_model_class = valid_polymorphic_class params["#{polymorphic_as}_type"]
|
203
203
|
|
204
204
|
if polymorphic_as.present?
|
205
205
|
model.send("#{polymorphic_as}_type=", valid_model_class)
|
@@ -217,6 +217,12 @@ module Avo
|
|
217
217
|
model
|
218
218
|
end
|
219
219
|
|
220
|
+
def valid_polymorphic_class(possible_class)
|
221
|
+
types.find do |type|
|
222
|
+
type.to_s == possible_class.to_s
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
220
226
|
def database_id
|
221
227
|
# If the field is a polymorphic value, return the polymorphic_type as key and pre-fill the _id in fill_field.
|
222
228
|
return "#{polymorphic_as}_type" if polymorphic_as.present?
|
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: 2.
|
4
|
+
version: 2.34.0
|
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: 2023-06-
|
12
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -1713,7 +1713,6 @@ files:
|
|
1713
1713
|
- config/credentials.yml.enc
|
1714
1714
|
- config/i18n-tasks.yml
|
1715
1715
|
- config/initializers/pagy.rb
|
1716
|
-
- config/master.key
|
1717
1716
|
- config/routes.rb
|
1718
1717
|
- config/spring.rb
|
1719
1718
|
- db/factories.rb
|
@@ -1977,9 +1976,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1977
1976
|
version: 2.6.0
|
1978
1977
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1979
1978
|
requirements:
|
1980
|
-
- - "
|
1979
|
+
- - ">="
|
1981
1980
|
- !ruby/object:Gem::Version
|
1982
|
-
version:
|
1981
|
+
version: '0'
|
1983
1982
|
requirements: []
|
1984
1983
|
rubygems_version: 3.3.3
|
1985
1984
|
signing_key:
|
data/config/master.key
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2aeb23d82b909d9c6b5abb62f7058c2a
|