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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ece1802c0aff8f4c7aa07963976459b3926348dec30e6bb626af4af3615ab079
4
- data.tar.gz: 9cc1670145ad39ec8fb09dee7f843eebb7912f9222b66378c3a15014d8ae341e
3
+ metadata.gz: dce48ff1282bab4437a07c321a0099ce1755e92c96d0b82a29e2d91577b33da4
4
+ data.tar.gz: de4b93b760c5177e9631c51957eda7915f817b3ab60ed8a24c8fe9be739e19f8
5
5
  SHA512:
6
- metadata.gz: dbe3867dfc4e1ba3299bbeb0ae5f4e0dbedb67d887f1a593d3565ded47c6c66df6f1ba3ed1971c212a3420f682bbd7c694121880c37f1d9f0d62f15c6d2a8baf
7
- data.tar.gz: b30c40416024a57cf39f1ab184b6cbbbf4a5d8ddbcc4460a7fafa01199e62b4a2b8269c7775709765a0f19bae3bc64db6b1dcfadeb1842d19ff7144cee35ad05
6
+ metadata.gz: 50614474a512b8b8f22eb0a10c2c225fbe13b122bd7719109a842af0e82beccbe7d3f1977f966cd5a1316f31a08d894467afb1cf9dbd9e99745b7bf21560a281
7
+ data.tar.gz: 7331125c451330a2926e980b51e8dba2e6b9072b97965aa40a1a2b7afb6367c1822185088749e55c011e0666ce4d50c95a111b51e5f1ddf175e95c8caaca5a7a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.33.3.pre.2)
4
+ avo (2.34.0)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -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 = BaseResource.valid_model_class params["#{polymorphic_as}_type"]
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
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.33.3.pre.2" unless const_defined?(:VERSION)
2
+ VERSION = "2.34.0" unless const_defined?(:VERSION)
3
3
  end
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.33.3.pre.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-05 00:00:00.000000000 Z
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: 1.3.1
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