avo 2.51.0 → 2.52.0

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: 47e343f6db0d2739fc03fcf0969f1f4a315d3d79502ce7c8179ff3e373820ce9
4
- data.tar.gz: 58fd4554a1f1bc28a3ead98ce1ee0350a2665b8778835a9dda7747bb855e814c
3
+ metadata.gz: ecf46732c743cb0408230bc9b73ec747d2094603d9ac4673b9a8bcf6e3510247
4
+ data.tar.gz: b74e17cfa53122dc69ccc4cf91578132f59ac3b3ef3f912e0991360db1380ecc
5
5
  SHA512:
6
- metadata.gz: 343a36a7b481bf9c42729b849e9aafd2409809ce7ae740f670d491aa5409b40d39a6523babf73e0ef4cb843d027eecb8c6ba438752545c9e7b78d8823cd540a3
7
- data.tar.gz: f7f1df73690020c4584b375754b08381e4174b39a911c8daf02980df2d1f8c679106e6f350404c6a56bf7ea82c63200c9ddf3b3147454e1246d3ceccad6708b0
6
+ metadata.gz: e9e9b5751953ed132817a67240cda51c1aa46c23331fe54715fac61207e60eba5cd1605b650b34eed205818b20fd8ce965757f40ba9b200974aae45a6aaf1660
7
+ data.tar.gz: f97d7ef68d013033215daed86e2be33bb116c37ddd9a6113bc8d4eb1954ede77689a20c664ea4e9fe896e726d96e4e2f909f6231bfbb5cfe07bc05e8275a4cd8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.51.0)
4
+ avo (2.52.0)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -114,7 +114,7 @@ module Avo
114
114
  end
115
115
 
116
116
  def get_record_associations(record)
117
- record._reflections
117
+ record.class.reflections
118
118
  end
119
119
 
120
120
  def valid_association_name(record, association_name)
@@ -382,7 +382,7 @@ module Avo
382
382
 
383
383
  if field.type == "belongs_to"
384
384
 
385
- reflection = @model._reflections[@params[:via_relation]]
385
+ reflection = @model.class.reflections[@params[:via_relation]]
386
386
 
387
387
  if field.polymorphic_as.present? && field.types.map(&:to_s).include?(@params[:via_relation_class])
388
388
  # set the value to the actual record
@@ -245,10 +245,10 @@ module Avo
245
245
 
246
246
  reflection_key = polymorphic_as || id
247
247
 
248
- if @model._reflections[reflection_key.to_s].klass.present?
249
- App.get_resource_by_model_name @model._reflections[reflection_key.to_s].klass.to_s
250
- elsif @model._reflections[reflection_key.to_s].options[:class_name].present?
251
- App.get_resource_by_model_name @model._reflections[reflection_key.to_s].options[:class_name]
248
+ if @model.class.reflect_on_association(reflection_key).klass.present?
249
+ App.get_resource_by_model_name @model.class.reflect_on_association(reflection_key).klass.to_s
250
+ elsif @model.class.reflect_on_association(reflection_key).options[:class_name].present?
251
+ App.get_resource_by_model_name @model.class.reflect_on_association(reflection_key).options[:class_name]
252
252
  else
253
253
  App.get_resource_by_name reflection_key.to_s
254
254
  end
@@ -59,10 +59,10 @@ module Avo
59
59
  end
60
60
 
61
61
  def target_resource
62
- if @model._reflections[id.to_s].klass.present?
63
- Avo::App.get_resource_by_model_name @model._reflections[id.to_s].klass.to_s
64
- elsif @model._reflections[id.to_s].options[:class_name].present?
65
- Avo::App.get_resource_by_model_name @model._reflections[id.to_s].options[:class_name]
62
+ if @model.class.reflect_on_association(id).klass.present?
63
+ Avo::App.get_resource_by_model_name @model.class.reflect_on_association(id).klass.to_s
64
+ elsif @model.class.reflect_on_association(id).options[:class_name].present?
65
+ Avo::App.get_resource_by_model_name @model.class.reflect_on_association(id).options[:class_name]
66
66
  else
67
67
  Avo::App.get_resource_by_name id.to_s
68
68
  end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.51.0" unless const_defined?(:VERSION)
2
+ VERSION = "2.52.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.51.0
4
+ version: 2.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-05-09 00:00:00.000000000 Z
13
+ date: 2024-08-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord