show gear image when no thumbnail URL present

Okay, surprise, the bug was unrelated to Camo config (though I'm glad I cleaned
that up anyway :P). We now, at a low level, serve a placeholder image for item
thumbnail URL if, for some reason, we don't have a good thumbnail URL on hand.
This commit is contained in:
Matt Dunn-Rankin 2017-04-01 10:29:12 -07:00
parent f54683464f
commit daa831e2b0
2 changed files with 7 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -328,7 +328,13 @@ class Item < ActiveRecord::Base
end
def thumbnail
@thumbnail ||= Image.from_insecure_url(thumbnail_url)
if thumbnail_url.present?
url = thumbnail_url
else
url = ActionController::Base.helpers.asset_path(
"broken_item_thumbnail.gif")
end
@thumbnail ||= Image.from_insecure_url(url)
end
def as_json(options={})