Ben/fix social image blank (#2675)

* Add profile_image_90 to serialized data on article

* Fix issue where empty string social image causes blank social image
This commit is contained in:
Ben Halpern 2019-05-03 11:09:21 -04:00 committed by GitHub
parent 07796e769a
commit 75fdf7fbed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,8 @@ module SocialImageHelper
end
def article_social_image_url(article)
if (image = article.social_image || article.main_image || article.video_thumbnail_url)
image = article.social_image || article.main_image || article.video_thumbnail_url
if image.present?
return cl_image_path(image,
type: "fetch",
width: "1000",
@ -26,6 +27,7 @@ module SocialImageHelper
sign_url: true)
end
return legacy_article_social_image(article) unless use_new_social_url?(article)
article_social_preview_url(article, format: :png)
end