avo 2.34.5 → 2.34.6
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 +2 -2
- data/app/components/avo/fields/file_field/index_component.rb +2 -2
- data/app/components/avo/fields/index_component.rb +1 -0
- data/app/controllers/avo/application_controller.rb +9 -2
- data/lib/avo/base_resource.rb +1 -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: 07a4019fae34650385f9b72af6444f8fcf582fcb9b69c64da0b9f18330db9094
|
4
|
+
data.tar.gz: 320fe93195ac2b24e97dac6361fa3ffe3456a695ca10e8a7edcc73d2c75945e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1840d1903d337a1977a9499cc204c5bb273e4b791aa97d702877e4d3212c19b61fde121bfb7f96c1f3c8b8551a11996cd55283e2207637856afb9167fa43f23b
|
7
|
+
data.tar.gz: 418635b25ca1e73c52f3f6f7c1426b1293c9fb1aa2d537eafb2bf3e3f9c9fc8755144fa539322fd79318da1b1189982221581f13a22632a642d524855b53a07a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (2.34.
|
4
|
+
avo (2.34.6)
|
5
5
|
actionview (>= 6.0)
|
6
6
|
active_link_to
|
7
7
|
activerecord (>= 6.0)
|
@@ -421,7 +421,7 @@ GEM
|
|
421
421
|
tzinfo (2.0.6)
|
422
422
|
concurrent-ruby (~> 1.0)
|
423
423
|
unicode-display_width (2.4.0)
|
424
|
-
view_component (3.
|
424
|
+
view_component (3.2.0)
|
425
425
|
activesupport (>= 5.2.0, < 8.0)
|
426
426
|
concurrent-ruby (~> 1.0)
|
427
427
|
method_source (~> 1.0)
|
@@ -6,10 +6,10 @@ class Avo::Fields::FileField::IndexComponent < Avo::Fields::IndexComponent
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def has_image_tag?
|
9
|
-
|
9
|
+
field.value.present? && field.value.attached? && field.value.representable? && field.is_image
|
10
10
|
end
|
11
11
|
|
12
12
|
def has_audio_tag?
|
13
|
-
|
13
|
+
field.value.present? && field.value.attached? && field.is_audio
|
14
14
|
end
|
15
15
|
end
|
@@ -235,8 +235,15 @@ module Avo
|
|
235
235
|
end
|
236
236
|
|
237
237
|
def eager_load_files(resource, query)
|
238
|
-
|
239
|
-
|
238
|
+
# Get the non-computed file fields and try to eager load them
|
239
|
+
attachment_fields = resource
|
240
|
+
.attachment_fields
|
241
|
+
.reject do |field|
|
242
|
+
field.computed
|
243
|
+
end
|
244
|
+
|
245
|
+
if attachment_fields.present?
|
246
|
+
attachment_fields.map do |field|
|
240
247
|
attachment = case field.class.to_s
|
241
248
|
when "Avo::Fields::FileField"
|
242
249
|
"attachment"
|
data/lib/avo/base_resource.rb
CHANGED
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.34.
|
4
|
+
version: 2.34.6
|
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-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|