Skip to content

Commit

Permalink
Fix RuboCop offense
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed Nov 15, 2023
1 parent 74c5ba3 commit 7477489
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/rails_admin/config/fields/types/active_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class ActiveStorage < RailsAdmin::Config::Fields::Types::FileUpload
end

register_instance_option :image? do
if value
value.representable? || mime_type(value.filename).to_s.match?(/^image/)
end
value && (value.representable? || mime_type(value.filename).to_s.match?(/^image/))
end

register_instance_option :eager_load do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ class ActiveStorageAttachment < RailsAdmin::Config::Fields::Types::MultipleFileU
end

register_instance_option :image? do
if value
value.representable? || mime_type(value.filename).to_s.match?(/^image/)
end
value && (value.representable? || mime_type(value.filename).to_s.match?(/^image/))
end

def resource_url(thumb = false)
Expand Down

0 comments on commit 7477489

Please sign in to comment.