Skip to content

Commit 1246376

Browse files
committed
Fix RuboCop offense
1 parent 0115935 commit 1246376

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/rails_admin/config/fields/types/active_storage.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ class ActiveStorage < RailsAdmin::Config::Fields::Types::FileUpload
1818
end
1919

2020
register_instance_option :image? do
21-
if value
22-
value.representable? || mime_type(value.filename).to_s.match?(/^image/)
23-
end
21+
value && (value.representable? || mime_type(value.filename).to_s.match?(/^image/))
2422
end
2523

2624
register_instance_option :eager_load do

lib/rails_admin/config/fields/types/multiple_active_storage.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ class ActiveStorageAttachment < RailsAdmin::Config::Fields::Types::MultipleFileU
2323
end
2424

2525
register_instance_option :image? do
26-
if value
27-
value.representable? || mime_type(value.filename).to_s.match?(/^image/)
28-
end
26+
value && (value.representable? || mime_type(value.filename).to_s.match?(/^image/))
2927
end
3028

3129
def resource_url(thumb = false)

0 commit comments

Comments
 (0)