Skip to content

Commit

Permalink
Remove unnecessary conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Mar 19, 2024
1 parent 244b7f9 commit 43d889a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions app/components/access_panels/library_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ def initialize(library:, document:)
end

def thumb_for_library
srcset = {}
image_name = if library.zombie?
srcset["#{library.code}@2x.png"] = '2x'
"#{library.code}.png"
else
srcset["#{library.code}@2x.jpg"] = '2x'
"#{library.code}.jpg"
end
suffix = library.zombie? ? 'png' : 'jpg'
srcset = { "#{library.code}@2x.#{suffix}" => '2x' }
image_name = "#{library.code}.#{suffix}"
image_tag(image_name, srcset:, class: "pull-left", alt: "", height: 50)
rescue Sprockets::Rails::Helper::AssetNotFound => e
Honeybadger.notify(e, error_message: "Missing library thumbnail for #{library.code}")
Expand Down
2 changes: 1 addition & 1 deletion lib/holdings/library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def holding_library?
end

def zombie?
@code == 'ZOMBIE'
@code == 'ZOMBIE' # e.g. a490837, a612226, a448849, in00000060570
end

def present?
Expand Down

0 comments on commit 43d889a

Please sign in to comment.